usersAdd.vue 69.9 KB
Newer Older
fukai committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
<template>
  <div style="height:100%;padding:3px 8px;overflow: auto;" class="userD-mag">
    <!--通讯,68-->
    <div id="showUserDetail">
    </div>
    <!--通讯,68-->
    <!--通讯,69-->
    <div id="saveUserDetail">
    </div>
    <!--通讯,69-->
    <!--通讯,70-->
    <div id="getNation">
    </div>
    <!--通讯,70-->
    <!--通讯,71-->
    <div id="getProvince">
    </div>
    <!--通讯,71-->
    <!--通讯,72-->
    <div id="getCitpaginationys">
    </div>
    <!--通讯,72-->
    <!--标签页,3-->
    <el-tabs ref="tab1" type="border-card" @tab-click="handleClick" style="height:auto;">
      <!--tabPane,13-->
      <el-tab-pane :label="userTitle">
        <!--表单,3-->
        <el-form ref="addUser" :model="user" tokenKey="addUser" label-width="120px"
                 :rules="rolesPass" :disabled="isDisabled">
          <!--输入框,37-->
          <el-input event-render="loadText" v-model="user.id"
                    type="text" :disabled="false" v-if="false">
          </el-input>
          <!--输入框,37-->
          <!--布局,27-->
          <el-row ref="thirdLine" :gutter="30">
            <!--col,49-->
            <el-col :span="11">
              <!--表单行,47-->
              <el-form-item :label="$t('statics.登录名:')" prop="logName" >
                <!--输入框,38-->
                <el-input event-render="loadText" v-model="user.logName"
                          type="text" :disabled="logNameDisabled" maxlength="8">
                </el-input>
                <!--输入框,38-->
              </el-form-item>
              <!--表单行,47-->
            </el-col>
            <!--col,49-->
            <!--col,50-->
            <el-col :span="11">
              <!--表单行,48-->
              <el-form-item :label="$t('statics.姓名:')" class="requireds" prop="name">
                <!--输入框,39-->
                <el-input event-render="loadText" v-model="user.name"
                          type="text" :disabled="false">
                </el-input>
                <!--输入框,39-->
              </el-form-item>
              <!--表单行,48-->
            </el-col>
            <!--col,50-->
          </el-row>
          <!--布局,27-->
          <!--布局,28-->
          <el-row ref="thirdLine" :gutter="30" v-if="setPassWord">
            <!--col,51-->
            <el-col :span="11">
              <!--表单行,49-->
              <el-form-item :label="$t('statics.密码:')" prop="logPass" class="requireds">
                <!--输入框,40-->
                <el-input event-render="loadText" v-model="user.logPass"
                          type="password" :disabled="false" >
                </el-input>
                <!--输入框,40-->
              </el-form-item>
              <!--表单行,49-->
            </el-col>
            <!--col,51-->
            <!--col,52-->
            <el-col :span="11">
              <!--表单行,50-->
              <el-form-item :label="$t('statics.确认密码:')" prop="confirmPass" class="requireds">
                <!--输入框,41-->
                <el-input event-render="loadText" v-model="user.confirmPass"
                          type="password" :disabled="false">
                </el-input>
                <!--输入框,41-->
              </el-form-item>
              <!--表单行,50-->
            </el-col>
            <!--col,52-->
          </el-row>
          <!--布局,28-->
          <!--布局,29-->
          <el-row ref="thirdLine" :gutter="30">
            <!--col,53-->
            <el-col :span="11">

              <el-form-item :label="$t('statics.归属行:')"  prop="workorg">
                <el-select v-model="user.workorg">
                  <el-option
                      v-for="item in branchlist"
                      :key="item.branch"
fukai committed
105
                      :label="$i18n.locale == 'zh' ? item.branch +' - '+ item.bchname : item.branch +' - '+ item.namen"
fukai committed
106 107
                      :value="item.branch"
                  >
fukai committed
108 109
					<span style="float: left" v-if="$i18n.locale === 'zh'">{{ item.branch }} - {{ item.bchname }}</span>
                	<span style="float: left" v-if="$i18n.locale === 'en'">{{ item.branch }} - {{ item.namen }}</span>
fukai committed
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
                  </el-option>
                </el-select>
              </el-form-item>

              <!--表单行,51-->
            </el-col>

            <el-col :span="11">
              <!--表单行,54-->
              <el-form-item :label="$t('statics.是否冻结:')"  prop="state">
                <!--单选框,18-->
                <el-radio v-model="user.state" label="3">
                  {{ $t('statics.是') }}
                </el-radio>
                <!--单选框,18-->
                <!--单选框,19-->
                <el-radio v-model="user.state" label="Y">
                  {{ $t('statics.否') }}
                </el-radio>
                <!--单选框,19-->
                <!--单选框,20-->
                <el-radio v-model="user.state" label="A">
                  {{ $t('statics.临时冻结') }}(10min)
                </el-radio>
                <!--单选框,20-->
              </el-form-item>
              <!--表单行,54-->
            </el-col>
          </el-row>

          <el-row ref="thirdLine" :gutter="30">
            <!--col,62-->
            <!--col,62-->
            <!--col,63-->
            <el-col :span="11">
              <!--表单行,61-->
              <el-form-item :label="$t('statics.电话:')"  prop="mobilePhone">
                <!--输入框,46-->
                <el-input event-render="loadText" v-model="user.mobilePhone"
                          type="text" :disabled="false">
                </el-input>
                <!--输入框,46-->
              </el-form-item>
              <!--表单行,61-->
            </el-col>

            <el-col :span="11">
              <!--表单行,62-->
              <el-form-item :label="$t('statics.传真:')"  prop="faxaPhone">
                <!--输入框,47-->
                <el-input event-render="loadText" v-model="user.faxaPhone"
                          type="text" :disabled="false">
                </el-input>
                <!--输入框,47-->
              </el-form-item>
              <!--表单行,62-->
            </el-col>
            <!--col,63-->
          </el-row>
          <!--布局,33-->
          <!--布局,34-->
          <el-row ref="thirdLine" :gutter="30">
            <!--col,64-->
            <el-col :span="11">
              <!--表单行,63-->
              <el-form-item :label="$t('statics.邮编:')" prop="postalcode">
                <!--输入框,48-->
                <el-input event-render="loadText" v-model="user.postalcode"
                          type="text" :disabled="false">
                </el-input>
                <!--输入框,48-->
              </el-form-item>
              <!--表单行,63-->
            </el-col>

            <el-col :span="11">
              <!--表单行,64-->
              <el-form-item :label="$t('statics.电子邮箱:')" prop="email">
                <!--输入框,49-->
                <el-input event-render="loadText" v-model="user.email"
                          type="text" :disabled="false">
                </el-input>
                <!--输入框,49-->
              </el-form-item>
              <!--表单行,64-->
            </el-col>
            <!--col,65-->
          </el-row>
          <!--布局,34-->
          <!--布局,35-->
          <el-row ref="thirdLine" :gutter="30">
            <!--col,66-->
            <el-col :span="11">
              <!--表单行,68-->
              <el-form-item :label="$t('statics.授权档次:')"  prop="authlevel">
                <c-select v-model="user.authlevel" dbCode="ATHLVL" :disabled="isFieldDisabled"></c-select>
              </el-form-item>
              <!--表单行,68-->
            </el-col>

            <el-col :span="11">
              <!--表单行,69-->
              <el-form-item :label="$t('statics.授权权限:')"  prop="relgrp">
                <c-select v-model="user.relgrp" dbCode="GRPCDE"></c-select>
              </el-form-item>
              <!--表单行,69-->
            </el-col>
          </el-row>

          <el-row :gutter="30">
            <!--col,71-->
            <el-col :span="11">
              <!--表单行,69-->
              <el-form-item :label="$t('statics.授权币种:')"  prop="relcur">
                <c-select v-model="user.relcur" dbCode="CURTXT"></c-select>
              </el-form-item>
              <!--表单行,69-->
            </el-col>
            <!--col,71-->
            <el-col :span="11">
              <!--表单行,68-->
              <el-form-item :label="$t('statics.授权金额:')"  prop="relamt">
                <!--输入框,53-->
                <el-input event-render="loadText" v-model="user.relamt"
                          type="text" :disabled="false">
                </el-input>
                <!--输入框,53-->
              </el-form-item>
              <!--表单行,68-->
            </el-col>
          </el-row>
          <el-row :gutter="30">
            <!--col,71-->
            <el-col :span="11">
              <!--表单行,69-->
fukai committed
245
              <el-form-item :label="$t('statics.关联机构:')"  prop="branchcode">
fukai committed
246 247 248 249
                <el-select v-model="user.branchcode" multiple>
                  <el-option
                      v-for="item in branchlist"
                      :key="item.branch"
fukai committed
250
                      :label="$i18n.locale == 'zh' ? item.branch +' - '+ item.bchname : item.branch +' - '+ item.namen"
fukai committed
251 252
                      :value="item.branch"
                  >
fukai committed
253 254 255
					<span style="float: left" v-if="$i18n.locale === 'zh'">{{ item.branch }} - {{ item.bchname }}</span>
                	<span style="float: left" v-if="$i18n.locale === 'en'">{{ item.branch }} - {{ item.namen }}</span>

fukai committed
256 257 258 259 260 261 262 263
                  </el-option>
                </el-select>
              </el-form-item>
              <!--表单行,69-->
            </el-col>
            <!--col,71-->
            <el-col :span="11">
              <!--表单行,68-->
fukai committed
264
              <el-form-item :label="$t('statics.关联角色:')"  prop="rolecode">
fukai committed
265
                <!--输入框,53-->
fukai committed
266
                <el-select v-model="user.rolecode"  multiple>
fukai committed
267 268 269
                  <el-option
                      v-for="item in rolelist"
                      :key="item.id"
fukai committed
270
                      :label="$i18n.locale == 'zh' ? item.id +' - '+ item.name : item.id +' - '+ item.extfield1"
fukai committed
271 272
                      :value="item.id"
                  >
fukai committed
273 274
				  <span style="float: left" v-if="$i18n.locale === 'zh'">{{ item.id }} - {{ item.name }}</span>
				  <span style="float: left" v-if="$i18n.locale === 'en'">{{ item.id }} - {{ item.extfield1 }}</span>
fukai committed
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359
                  </el-option>
                </el-select>
                <!--输入框,53-->
              </el-form-item>
              <!--表单行,68-->
            </el-col>
          </el-row>
          <!--布局,36-->
          <el-row ref="thirdLine" :gutter="30">
            <!--col,67-->
            <el-col :span="11">
              <!--表单行,65-->
              <el-form-item :label="$t('statics.附加信息1:')" prop="extfield1">
                <!--输入框,50-->
                <el-input event-render="loadText" v-model="user.extfield1"
                          type="text" :disabled="false">
                </el-input>
                <!--输入框,50-->
              </el-form-item>
              <!--表单行,65-->
            </el-col>
            <!--col,67-->
            <el-col :span="11">
              <!--表单行,66-->
              <el-form-item :label="$t('statics.附加信息2:')"  prop="extfield2">
                <!--输入框,51-->
                <el-input event-render="loadText" v-model="user.extfield2"
                          type="text" :disabled="false">
                </el-input>
                <!--输入框,51-->
              </el-form-item>
              <!--表单行,66-->
            </el-col>
          </el-row>
          <!--布局,36-->
          <!--布局,37-->
          <el-row ref="thirdLine" :gutter="30">
            <!--col,69-->
            <el-col :span="11">
              <!--表单行,67-->
              <el-form-item :label="$t('statics.附加信息3:')"  prop="extfield3">
                <!--输入框,52-->
                <el-input event-render="loadText" v-model="user.extfield3"
                          type="text" :disabled="false">
                </el-input>
                <!--输入框,52-->
              </el-form-item>
              <!--表单行,67-->
            </el-col>
            <!--col,69-->
            <el-col :span="11">
              <!--表单行,68-->
              <el-form-item :label="$t('statics.附加信息4:')"  prop="extfield4">
                <!--输入框,53-->
                <el-input event-render="loadText" v-model="user.extfield4"
                          type="text" :disabled="false">
                </el-input>
                <!--输入框,53-->
              </el-form-item>
              <!--表单行,68-->
            </el-col>
          </el-row>
          <!--布局,37-->
          <!--布局,38-->
          <el-row :gutter="30">
            <!--col,71-->
            <el-col :span="11">
              <!--表单行,69-->
              <el-form-item :label="$t('statics.附加信息5:')"  prop="extfield5">
                <!--输入框,54-->
                <el-input event-render="loadText" v-model="user.extfield5"
                          type="text" :disabled="false">
                </el-input>
                <!--输入框,54-->
              </el-form-item>
              <!--表单行,69-->
            </el-col>
            <!--col,71-->
          </el-row>
          <!--布局,38-->
          <!--布局,39-->
          <!--布局,39-->
        </el-form>
        <el-row>
          <el-col :span="24" class="text-center subBtn">
fukai committed
360
            <el-button type="primary" ref="userSubmitBtn" v-if="isShowSubmit" :loading="false" icon="el-icon-circle-check" @click="saveUser('addUser')">
fukai committed
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384
              {{ $t('statics.提交') }}
            </el-button>
            <el-button type="primary" :loading="false" icon="el-icon-refresh-left" native-type="reset" :disabled="false" @click="goBack()">
              {{ $t('statics.返回') }}
            </el-button>
            <el-button type="primary" v-if="passWordBtn && !setPassWord" :loading="false" icon="el-icon-refresh" @click="changePassW">
              {{ $t('statics.重设密码') }}
            </el-button>
          </el-col>
        </el-row>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script type="text/javascript">
import * as iscMessage from '@/util/isc-common/messageManage.js'
import dateFormat from '@/util/date/dateFormat.js'

import { Col,TabPane,RadioGroup,Form,FormItem,Radio,RadioButton,TableColumn,Card,Input,Button,Dialog,Select,Tree,Tabs,Option,DatePicker,Row,Popover} from 'element-ui'

import { IscPagingTable} from '@/components/isc'
import RelatedOrgChild from '@/page/Statics/Usr/RelatedOrg.vue';
import Api from "@/service/Api";
export default {
fukai committed
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458
  name: "userAdd",
  data () {
    return {
      branchlist:[],
      rolelist:[],
      editPriority: '5',
      selectDataList: [],
      limit: 100,
      offset: 0,
      userID:0,
      btnType:"",
      isDisabled:false,
      isShowSubmit:true,
      setPassWord:false,
      passWordBtn:false,
      cityList:[],
      nationList:[],
      provinceList:[],
      relationTableRef:'',
      openOrgDialog:false,
      orgTreeDialogbtn:true,
      orgTreeblongbtn:false,
      userTitle:this.$t('statics.新增用户'),
      Dialogtitle:this.$t('statics.机构数据'),
      nodeProp:{children:'children',label: 'text',isLeaf: 'leaf'},
      GroupGridList:null,
      OrgGridList:null,
      PostGridList:null,
      DepartGridList:null,
      RoleGridList:null,
      openDeptDialog:false,
      openDepartDialog:false,
      deptNode:null,
      deptResolve:null,
      orgNode:null,
      orgResolve:null,
      deptTreeData:[{label: this.$t('statics.一级 1'),children: [{label: this.$t('statics.二级 1-1'),children: [{label: this.$t('statics.三级 1-1-1') }]}]}],
      orgTreeData:[{label: this.$t('statics.一级 1'),children: [{label: this.$t('statics.二级 1-1'),children: [{label: this.$t('statics.三级 1-1-1') }]}]}],
      openGroupDialog:false,
      openPostDialog:false,
      openRoleDialog:false,
      groupTreeData:[],
      postTreeData:[],
      RoleTreeData:[],
      orgRadio:'',
      orgRow:null,
      departRadio:'',
      departRow:null,
      postRadio:'',
      postRow:null,
      groupRadio:'',
      groupRow:null,
      roleRadio:'',
      roleRow:null,
      clickListRow:null,
      ddddd:[{'label':this.$t('statics.选项'),'value':'11','disabled':true},{'label':this.$t('statics.选项一')}],
      orgData:'',
      orgDataList:[],
      departmentDataList:[],
      delGroup:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/group/relation/{userid}/{groupid}"},
      delRole:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/qukacc/User/role/relation/{userid}/{roleid}/{departmentid}"},
      searchDepart:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/depart/relation/{userid}"},
      saveDepart:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/depart/relation/put"},
      savePost:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/post/relation/put"},
      delOrgd:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/usr/User/org/relation/{userid}/{orgid}"},
      getDepartFlag:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/depart/flag/{departnum}"},
      searchPost:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/post/relation/{userid}"},
      // searchRoleOrg:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/org/relation/{userid}"},
      selectGroupTree:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/group/relation/grouptree/{userid}"},
      searchRole:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/role/relation/{userid}"},
      getProvince:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/province"},
      selectPostTree:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/post/relation/posttree/{userid}"},
      submitGroup:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/group/relation"},
      submitRole:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/usr/User/role/relation"},
fukai committed
459
      selectRoletree:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/admin/usr/allroletree"},
fukai committed
460 461 462 463 464 465
      selectSubRoletree:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/usr/User/conn/subroletree/{currentLoginUserRoleId}"},
      delDepart:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/depart/relation/{userid}/{departId}"},
      searchOrg:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/org/relation/{userid}"},
      saveGroup:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/group/relation/put"},
      getNation:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/nation"},
      saveRole:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/usr/User/role/relation/put"},
fukai committed
466
      showUserDetail:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/admin/usr/userdetail/userid/{id}"},
fukai committed
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525
      getDeptTreeChild:{"fileName":"department.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/department/find/treeNode/{departmentNumber}"},
      saveOrgd:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/usr/User/org/relation/put"},
      saveUserDetail:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/usr/saveUsr"},
      delPost:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/post/relation/{userid}/{postid}"},
      getDepartTreeA:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/userrest/depart/relation/departtree/all"},
      submitPost:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/post/relation"},
      getOrgChildTree:{"fileName":"orgs.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/orgs/org/parentorg/{parentid}"},
      getCitys:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/province/city/{provinceid}"},
      saveOrgUserRel:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/usr/User/org/relation"},
      getDeptTree:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/departtree/all/{workorg}"},
      saveDepartRe:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/depart/relation"},
      getOrgParentTree:{"fileName":"orgs.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/orgs/org/getDepartParent"},
      searchGroup:{"fileName":"users.json","basePath":"{{basePath}}","method":"get","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/users/User/group/relation/{userid}"},
      saveInfo:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/uro/saveInfo"},
      deleteInfo:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/uro/deleteInfo"},
      // checkUser:{"fileName":"users.json","basePath":"{{basePath}}","method":"post","scheme":"{{schemes}}","host":"{{host}}","consume":"0","produce":"0","uri":"/usr/isHeadBankUser/{id}"},
      rolesPass:{
        logName: [{ required: true, message: this.$t('statics.请输入柜员号')}],
        name: [{ required: true, message: this.$t('statics.请输入姓名')}],
        workorg: [{ required: true, message: this.$t('statics.请选择归属行')}],
        logPass: [{ required: true, message: this.$t('statics.请输入密码'), trigger: 'blur' }, { max: 15, message: this.$t('statics.密码长度不能超过15位'), trigger: 'blur' }],
        confirmPass: [{validator: this.validatePass2, trigger: 'blur'}],
        relgrp:[{ required: true, message: this.$t('statics.请选择授权权限'),trigger: 'blur'},],
        branchcode:[{ required: true, message: this.$t('statics.请选择关联机构'),trigger: 'blur'},],
        rolecode:[{ required: true, message: this.$t('statics.请选择关联角色'),trigger: 'blur'},],
      },
    user:{
      rolecode:{
        id:"",
        name:"",
      },
      branchcode:{
        branch:"",
        bchname:"",
      },
      extfield1:'',
      extfield2:'',
      extfield3:'',
      extfield4:'',
      extfield5:'',
      mobilePhone:'',
      postalcode:'',
      email:'',
      state:'Y',
      workDept:'',
      workDeptName:'',
      workorg:'',
      workorgName:'',
      faxaPhone:'',
      confirmPass:'',
      logPass:'',
      logName:'',
      name:'',
      id:'',
      relgrp:'', // 授权权限
      relcur:'', // 授权币种
      relamt:'', // 授权金额
      authlevel:'', // 授权档次
      role:'',//用户关联角色
fukai committed
526
    },
fukai committed
527 528
      scope:{
          row:''
fukai committed
529
    },
fukai committed
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561
    logNameDisabled:false,
    isFieldDisabled: true
    }
  },
  components: {
      'isc-paging-table':IscPagingTable,
      'el-radio-group':RadioGroup,
      'el-form':Form,
      'el-radio':Radio,
      'el-col':Col,
      'el-radio-button':RadioButton,
      'el-input':Input,
      'el-option':Option,
      'el-row':Row,
      'el-tabs':Tabs,
      'el-button':Button,
      'el-select':Select,
      'el-form-item':FormItem,
      'el-date-picker':DatePicker,
      'el-dialog':Dialog,
      'el-table-column':TableColumn,
      'el-card':Card,
      'el-popover':Popover,
      'el-tree':Tree,
    'el-tab-pane':TabPane,
    'el-related-org-child':RelatedOrgChild
  },
  mounted (){
    this.$parent.hideChild = false;
    this.userID = this.$route.query.id;
    this.isDisabled = false;
    this.isShowSubmit = true;
fukai committed
562
    this.logNameDisabled = false;
fukai committed
563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579
    this.btnType = this.$route.query.btnType;
    this.bch_init();
    this.role_init();
    let $this = this;
    this.$el.querySelectorAll('*[isToken]').forEach(function(el,index){
      var key =el.getAttribute('tokenKey');
      iscMessage.getTokenID($this,key);
    });
    this.$el.querySelectorAll('*[data-init]').forEach(function(el,index){
      var init =el.getAttribute('data-init');
      var message = iscMessage.initMessageKey(init);
      $this.poin_initManage(message[0],message[1],message[2]);
    });
    if(this.userID == null){
      //增加,显示密码框
      this.setPassWord = true;
      this.logNameDisabled = false;
fukai committed
580
      this.isFieldDisabled=false;
fukai committed
581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632
    }
    else{
      //修改 ,显示重置密码按钮,反显数据
      this.logNameDisabled = true;
      if(this.btnType == "info"){
        this.passWordBtn=false;
        this.userTitle=this.$t('statics.查看用户');
        this.isDisabled = true;
        this.isShowSubmit = false;
      }else{
        this.passWordBtn=true;
        this.userTitle=this.$t('statics.修改用户');
        this.isFieldDisabled=false;
        // this.checkUserInfo();
      }
      this.user.id = this.userID;
      this.poin_initManage({"id":"showUserDetail"},function afterLoad(response,responseData){
        if(response.ok){
          let bchList=responseData.data.branchList;
          let tmpList=[]
          bchList.forEach((item) => {
            tmpList.push(item.BRANCH);
          });
          let roleList=responseData.data.roleList;
          let tmpList2=[]
          roleList.forEach((item2) => {
            tmpList2.push(item2.ROLEID);
          });
          $this.user.rolecode=tmpList2;
          $this.user.branchcode=tmpList;
          $this.user.id= responseData.data.id;
          $this.user.logName=responseData.data.extkey;
          $this.user.name= responseData.data.nam;
          $this.user.workorg= responseData.data.workorg;
          $this.user.mobilePhone=responseData.data.tel;
          $this.user.faxaPhone= responseData.data.fax;
          $this.user.postalcode= responseData.data.postalcode;
          $this.user.relgrp = responseData.data.relgrp;
          $this.user.authlevel = responseData.data.authlevel;
          $this.user.relcur = responseData.data.relcur;
          $this.user.relamt = responseData.data.relamt;
          $this.user.logPass=responseData.data.password;
          $this.user.email=responseData.data.eml;
          $this.user.workDept= responseData.data.workDept;
          $this.user.workDeptName=responseData.data.workDeptName;
          $this.user.confirmPass=responseData.data.confirmPass;
          $this.user.extfield1= responseData.data.extfield1;
          $this.user.extfield2= responseData.data.extfield2;
          $this.user.extfield3= responseData.data.extfield3;
          $this.user.extfield4= responseData.data.extfield4;
          $this.user.extfield5= responseData.data.extfield5;
          $this.user.state = responseData.data.secsta;
fukai committed
633
        }
fukai committed
634 635 636
      },function beforLoad(messageObj){
        messageObj.loading =true;
        messageObj.setUriParam({"id":$this.userID});	 
fukai committed
637
      });
fukai committed
638 639 640 641 642 643 644
    };
    this.poin_initManage({
    "id":"searchRoleOrg",
    'responseFields':{'total':'%OrgRelationGrid.total'},
    'requestFields':{'offset':'#offset','limit':'#limit'}},
    'afterGetUserRelations',
    'beforGetUserRelations');
fukai committed
645
  },
fukai committed
646 647
  methods : {
    bch_init(){
fukai committed
648
      Api.post('/admin/bch/getBchListForUsr',{}).then(res=>{
fukai committed
649 650 651 652 653
            this.branchlist = res.data;
          }
      )
    },
    role_init(){
fukai committed
654
      Api.post('/admin/role/getRoleList',{}).then(res=>{
fukai committed
655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687
            this.rolelist = res.data;
          }
      )
    },
    poin_initManage(messageKey,callback,execBefore){
      messageKey.vue = this;
      iscMessage.messageManage(messageKey,callback,execBefore);
    },
    async saveUser(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          if(this.userID == null){
            this.$confirm(this.$t('statics.是否确定添加用户?'), this.$t('statics.提示'), {
              confirmButtonText: this.$t('statics.确认'),
              cancelButtonText: this.$t('statics.取消'),
              type: "warning",
            }).then(async (res) => {
              let params = {
                extkey:this.user.logName,
                nam:this.user.name,
                passwd:this.user.logPass,
                secsta:this.user.state,
                tel:this.user.mobilePhone,
                fax:this.user.faxaPhone,
                eml:this.user.email,
                authlevel:this.user.authlevel,
                relgrp:this.user.relgrp,
                relcur:this.user.relcur,
                relamt:this.user.relamt,
                branch:this.user.branchcode,
                role:this.user.rolecode,
                workorg:this.user.workorg,
              };
fukai committed
688
              await Api.post('/admin/usr/addusr', params)
fukai committed
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731
              .then((res) => {
                if (res.respCode == "AAAAAA" || res.respCode == "AAAAAA") {
                  this.$notify({
                    title: this.$t('components.成功'),
                    message: this.$t('components.校验成功'),
                    type: "success",
               });
                } else {
                  this.$notify({
                    title: this.$t('components.失败'),
                    message: this.$t('components.校验失败'),
                    type: 'error',
                  });
                }

              });
              //this.$router.push({name:'userSearch'});
              this.routerPush({
                path: '/iscOrganization/userManage'
              })
              this.$parent.$refs.userTable.refresh();
            });
          }else{
            this.$confirm(this.$t('statics.是否确定修改该用户?'), this.$t('statics.提示'), {
              confirmButtonText: this.$t('statics.确认'),
              cancelButtonText: this.$t('statics.取消'),
              type: "warning",
            }).then(async (res) => {
              let params = {
                extkey:this.user.logName,
                nam:this.user.name,
                secsta:this.user.state,
                tel:this.user.mobilePhone,
                fax:this.user.faxaPhone,
                eml:this.user.email,
                authlevel:this.user.authlevel,
                relgrp:this.user.relgrp,
                relcur:this.user.relcur,
                relamt:this.user.relamt,
                branch:this.user.branchcode,
                role:this.user.rolecode,
                workorg:this.user.workorg,
              };
fukai committed
732
              await Api.post('/admin/usr/updateusr', params).then((res) => {
fukai committed
733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895
                if (res.respCode == "AAAAAA" || res.respCode == "AAAAAA") {
                  this.$notify({
                    title: this.$t('components.成功'),
                    message: this.$t('components.校验成功'),
                    type: "success",
               });
                } else {
                  this.$notify({
                    title: this.$t('components.失败'),
                    message: this.$t('components.校验失败'),
                    type: 'error',
                  });
                }

              });;
              this.routerPush({
                path: '/iscOrganization/userManage'
              })
              this.$parent.$refs.userTable.refresh();
            });
          }
        } 
        
        // else {
        //   this.$notify({
        //     title: this.$t('components.失败'),
        //     message: this.$t('components.校验失败'),
        //     type: 'error',
        //   });
        // }
      });
    },
    beforGetUserRelations(messageObj){
      //根据用户查询所属机构,部门,工作组,岗位,角色表
      if(this.userID == null){
      //增加用户,不用查询关联表信息
        messageObj.closeFlag = true;
      }else{
        messageObj.closeFlag = false;
      }
      messageObj.setUriParam({"userid":this.userID});
    },
    beforGetRoleOrg(messageObj){
      //根据用户查询所属机构,部门,工作组,岗位,角色表
      if(this.userID == null){
      //增加用户,不用查询关联表信息
        messageObj.closeFlag = true;
      }else{
        messageObj.closeFlag = false;
      }
      messageObj.setUriParam({"userid":this.userID});
      messageObj.addRequestParam({
        "offset": 0,
      })
    },
    afterGetRole(res,data){
      if(res && res.ok && data){
        this.RoleGridList = data.rows
        }
    },
    afterGetUserRelations(res,data) {
      if(res && res.ok && data){
        var selectList = data.rows;
        this.orgDataList = [];
        for(var i =0; i < selectList.length; i++){
          var option = {};
          option.label = selectList[i].name;
          option.value = +selectList[i].nodeId;
          this.orgDataList.push(option);
        }   
          this.orgDataList.unshift({label:this.$t('statics.所有机构'),value: 0})
          this.selectDataList =  this.orgDataList.concat(this.departmentDataList)
        }
    },
    afterGetUserDepartment(res,data) {
      if(res && res.ok && data){
        var selectList = data.rows;
        this.departmentDataList = [];
        for(var i =0; i < selectList.length; i++){
          var option = {};
          option.label = selectList[i].name;
          option.value = +selectList[i].departmentNumber;
          this.departmentDataList.push(option);
        }
        this.selectDataList =  this.orgDataList.concat(this.departmentDataList)
        }
    },
    checkOrgBlong(){
      //选择归属行弹出框
      if(this.orgNode != null){
        //重新渲染机构树
        this.orgTreeData =[];
        this.searchChild(this.orgNode, this.orgResolve);
      }
      this.Dialogtitle = this.$t('statics.归属行');
      this.orgTreeDialogbtn =false;
      this.orgTreeblongbtn =true;
      this.openOrgDialog = true;
    
    },
    checkDeptBtn(){
      //选择归属部门->弹出框
      if(this.user.workorgName){
        this.openDeptDialog = true;
        if(this.deptNode != null){
          //需要重新渲染部门树
          this.deptTreeData =[];
          this.searchDeptChild(this.deptNode, this.deptResolve);
        }
      }else{
        this.$message({message: this.$t('statics.请先选择归属行!'),center: true,type: 'warning'});
      }
    },
    addOrglistBtn(){
      //增加机构->弹出框
      if(this.orgRow){
        this.orgRow = null;
        this.orgRadio = null;
      }
      if(this.userID == null){
        this.$message({message: this.$t('statics.请先保存用户信息!'),center: true,type: 'warning'});
      }else{
        if(this.orgNode != null){
          //需要重新渲染机构树
          this.orgTreeData =[];
          this.searchChild(this.orgNode, this.orgResolve);
        }
        this.Dialogtitle = this.$t('statics.机构数据');
        this.orgTreeDialogbtn =true;
        this.orgTreeblongbtn =false;
        this.openOrgDialog = true;
      }
    },
    addDeptlistBtn(){
    //增加部门列表->弹出框
    if(this.departRow){
        this.departRow = null;
        this.departRadio = null;
      }
      if(this.userID == null){
        this.$message({message: this.$t('statics.请先保存用户信息!'),center: true,type: 'warning'});
      }else{
      this.openDepartDialog =true;
      this.$nextTick(()=>{
        var node = this.$refs.departTree.getCurrentNode();
          if(node != null){
          this.$refs.departTree.setCurrentKey(null);
          }
      })
      }
    },
    saveOrgBtn(){
      //修改机构保存
      var $this = this;
      this.relationTableRef = "OrgRelationGrid";
      var selectData = this.orgRow;
      if(selectData != null && selectData.ifDefault == 1 && selectData.state == 0){
        $this.$message({message: this.$t('statics.默认机构不能为锁定状态!'),center: true,type: 'warning'});
        // 清空选中状态
        this.orgRow =null;
        this.orgRadio ='';
        // 刷新当前表格
        this.$refs[this.relationTableRef].refresh();
fukai committed
896 897
        return;
      }
fukai committed
898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063
      this.poin_initManage({'id':'saveOrgd'},'saveUserRelation',function beforSaveOrgD(messageObj){
        //后台返回的字符串,默认是json,所以这里指定一下类型
        //messageObj.responseType="text/html";
        if(selectData != null){
          messageObj.closeFlag = false;
          messageObj.setData(JSON.stringify([{"departId":selectData.id,"state":selectData.state,"ifDefault":selectData.ifDefault,"personId":$this.userID}]));
          //记录当前点击的行 和 按钮
          $this.clickListRow = "orgRow";
          $this.clickRowRadio = "orgRadio";
        }else{
          $this.$message({message: this.$t('statics.请选择一条数据修改!'),center: true,type: 'warning'});
          messageObj.closeFlag = true;
        }
      })
    },
    saveDeptBtn(){
      //修改部门保存
      var $this = this;
      this.relationTableRef = "DepartRelationGrid";
      var selectData = this.departRow;
      this.poin_initManage({'id':'saveDepart'},'saveUserRelation',function beforSaveOrgD(messageObj){
        if(selectData != null){
          messageObj.closeFlag = false;
          messageObj.setData(JSON.stringify({"departId":selectData.departmentNumber,"state":selectData.state,"personId":$this.userID}));
          //记录当前点击的行 和 按钮
          $this.clickListRow = "departRow";
          $this.clickRowRadio = "departRadio";
        }else{
          $this.$message({message: this.$t('statics.请选择一条数据修改!'),center: true,type: 'warning'});
          messageObj.closeFlag = true;
        }
      })
    },
    saveGroupBtn(){
      //修改工作组保存
      var $this = this;
      this.relationTableRef = "GroupRelationGrid";
      var selectData = this.groupRow;
      this.poin_initManage({'id':'saveGroup'},'saveUserRelation',function beforSaveOrgD(messageObj){
        if(selectData != null){
          messageObj.closeFlag = false;
          messageObj.setData(JSON.stringify({"groupId":selectData.id,"state":selectData.state,"personId":$this.userID}));
          //记录当前点击的行 和 按钮
          $this.clickListRow = "groupRow";
          $this.clickRowRadio = "groupRadio";
        }else{
          $this.$message({message: this.$t('statics.请选择一条数据修改!'),center: true,type: 'warning'});
          messageObj.closeFlag = true;
        }
      })
    },
    savePostBtn(){
      //修改岗位保存
      var $this = this;
      this.relationTableRef = "PostRelationGrid";
      var selectData = this.postRow;
      this.poin_initManage({'id':'savePost'},'saveUserRelation',function beforSaveOrgD(messageObj){
        if(selectData != null){
          messageObj.closeFlag = false;
          messageObj.setData(JSON.stringify({"postId":selectData.id,"state":selectData.state,"personId":$this.userID}));
          //记录当前点击的行 和 按钮
          $this.clickListRow = "postRow";
          $this.clickRowRadio = "postRadio";
        }else{
          $this.$message({message: this.$t('statics.请选择一条数据修改!'),center: true,type: 'warning'});
          messageObj.closeFlag = true;
        }
      })
    },
    saveRoleBtn(){
      //修改角色保存
      var $this = this;
      this.relationTableRef = "RoleRelationGrid";
      var selectData = this.roleRow;
      if(selectData != null && selectData.ifDefault == 1 && selectData.state == 0){
        $this.$message({message: this.$t('statics.默认角色不能为锁定状态!'),center: true,type: 'warning'});
        // 清空选中状态
        this.roleRow =null;
        this.roleRadio ='';
        // 刷新当前表格
        this.$refs[this.relationTableRef].refresh();
        return;
      }
      this.poin_initManage({'id':'saveRole'},'saveUserRelation',function beforSaveOrgD(messageObj){
        if(selectData != null){
          messageObj.closeFlag = false;
          messageObj.setData(JSON.stringify({"roleId":selectData.id,"state":selectData.state,"ifDefault":selectData.ifDefault,"personId":$this.userID,"departmentId":selectData.departmentId,"oldDepartmentId":selectData.oldDepartmentId,"priority":selectData.priority}));
          //记录当前点击的行 和 按钮
          $this.clickListRow = "roleRow";
          $this.clickRowRadio = "roleRadio";
        }else{
          $this.$message({message: this.$t('statics.请选择一条数据修改!'),center: true,type: 'warning'});
          messageObj.closeFlag = true;
        }
      })
    },
    delOrgBtn(){
      //删除机构
      var $this = this;
      this.relationTableRef = "OrgRelationGrid";
      var selectData = this.orgRow;
      if(selectData != null){
        if(selectData.ifDefault == 1){
          $this.$message({message: this.$t('statics.不能删除默认机构!'),center: true,type: 'warning'});
          return;
        }
        $this.$confirm('确定要删除该机构吗?', '提示', {
                confirmButtonText: this.$t('statics.确定'),
                cancelButtonText: this.$t('statics.取消'),
                type: 'warning'
              }).then(() => {
              this.poin_initManage({'id':'delOrgd'},'afterDelUserRelation',function beforeDelOrgD(messageObj){
              messageObj.setUriParam({
                "userid":$this.userID,
                "orgid":selectData.id
              });
              $this.clickListRow = "orgRow";
              $this.clickRowRadio = "orgRadio";
            });
            this.deleteRelatedOrg(selectData.id,$this.userID);
              }).catch(() => {
                $this.$message({
                  type: 'info',
                  message: this.$t('statics.已取消删除')
                });          
              });	
        }else{
          $this.$message({message: this.$t('statics.请选择一条数据进行删除!'),center: true,type: 'warning'});
        }
    },
    delDeptBtn(){
      //删除部门
      var $this = this;
      this.relationTableRef = "DepartRelationGrid";
      var selectData = this.departRow;
      if(selectData != null){
        $this.$confirm(this.$t('statics.删除该部门将会连同该部门对应角色一同删除,确认删除吗?'), this.$t('statics.提示'), {
                confirmButtonText: this.$t('statics.确定'),
                cancelButtonText: this.$t('statics.取消'),
                type: 'warning'
              }).then(() => {
                this.poin_initManage({'id':'delDepart'},'afterDelUserRelation',function beforeDelOrgD(messageObj){
              messageObj.setUriParam({
                "userid":$this.userID,
                "departId":selectData.departmentNumber
              });
              $this.clickListRow="departRow";
              $this.clickRowRadio = "departRadio";
                });
              }).catch(() => {
                $this.$message({
                  type: 'info',
                  message: this.$t('statics.已取消删除')
                });          
              });	
      }else{
        $this.$message({message: this.$t('statics.请选择一条数据进行删除!'),center: true,type: 'warning'});
        }
    },
    delGroupBtn(){
      //删除工作组
      var $this = this;
      this.relationTableRef = "GroupRelationGrid";
      var selectData = this.groupRow;
      this.poin_initManage({'id':'delGroup'},'afterDelUserRelation',function beforeDelOrgD(messageObj){
        if(selectData != null){
fukai committed
1064 1065 1066
          messageObj.closeFlag = false;
          messageObj.setUriParam({
            "userid":$this.userID,
fukai committed
1067
            "groupid":selectData.id
fukai committed
1068
          });
fukai committed
1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103
          $this.clickListRow ="groupRow";
          $this.clickRowRadio = "groupRadio";
        }else{
          $this.$message({message: this.$t('statics.请选择一条数据进行删除!'),center: true,type: 'warning'});
          messageObj.closeFlag = true;
        }
      });
    },
    delPostBtn(){
      //删除岗位
      var $this = this;
      this.relationTableRef = "PostRelationGrid";
      var selectData = this.postRow;
      this.poin_initManage({'id':'delPost'},'afterDelUserRelation',function beforeDelOrgD(messageObj){
        if(selectData != null){
          messageObj.closeFlag = false;
          messageObj.setUriParam({
            "userid":$this.userID,
            "postid":selectData.id
          });
          $this.clickListRow ="postRow";
          $this.clickRowRadio = "postRadio";
        }else{
          $this.$message({message: this.$t('statics.请选择一条数据进行删除!'),center: true,type: 'warning'});
          messageObj.closeFlag = true;
        }
      });
    },
    delRoleBtn(){
      //删除角色
      var $this = this;
      this.relationTableRef = "RoleRelationGrid";
      var selectData = this.roleRow;
      if(selectData != null && selectData.ifDefault == 1){
        $this.$message({message: this.$t('statics.不能删除默认角色!'),center: true,type: 'warning'});
fukai committed
1104 1105
        return;
      }
fukai committed
1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142
      if(selectData != null){
        $this.$confirm(this.$t('statics.确定要删除该角色吗?'), this.$t('statics.提示'), {confirmButtonText: this.$t('statics.确定'),cancelButtonText: this.$t('statics.取消'),type: 'warning'})
        .then(() => {
          this.poin_initManage({'id':'delRole'},'afterDelUserRelation',function beforeDelOrgD(messageObj){
            messageObj.closeFlag = false;
            messageObj.setUriParam({
              "userid":$this.userID,
              "roleid":selectData.id,
              "departmentid":selectData.departmentId
            });
            $this.clickListRow ="roleRow";
            $this.clickRowRadio = "roleRadio";
          });
        })
        .catch(() => {$this.$message({type: 'info', message: this.$t('statics.已取消删除')})});
      } else {
        $this.$message({message: this.$t('statics.请选择一条数据进行删除!'),center: true,type: 'warning'});
      }
    },
    saveUserRelation(response,responseData){
      //执行机构,部门,岗位,角色,工作组【修改保存】
      if(response.ok){
        if(this.clickListRow == "orgRow" && responseData.canModify == "false"){
          this[this.clickListRow].ifDefault = 1;
          this[this.clickListRow] =null;
          this[this.clickRowRadio] ='';
          this.$message({message: this.$t('statics.必须要有一条默认机构!'),center: true,type: 'error'});
          return;
        }
        if(this.clickListRow == "roleRow" && responseData.canModify == "false"){
          this[this.clickListRow].ifDefault = 1;
          this[this.clickListRow] =null;
          this[this.clickRowRadio] ='';
          this.$message({message: this.$t('statics.必须要有一条默认角色!'),center: true,type: 'error'});
          return;
        }
        //成功后把当前操作行状态清空
fukai committed
1143 1144
        this[this.clickListRow] =null;
        this[this.clickRowRadio] ='';
fukai committed
1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155
        this.$message({message: this.$t('statics.保存成功!'),center: true,type: 'success'});
        //刷新当前表格
        this.$refs[this.relationTableRef].refresh();
      }else{
      //提示错误
        //把当前操作行状态清空
        this[this.clickListRow] =null;
        this[this.clickRowRadio] ='';
        //刷新当前表格
        this.$refs[this.relationTableRef].refresh();
        this.$message({message:responseData.errorMsg,center: true,type: 'warning'});
fukai committed
1156
      }
fukai committed
1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170
    },
    afterDelUserRelation(response,responseData){
      //执行机构,部门,岗位,角色,工作组【删除】
      if(response.ok){
        //当前点击行删除后,清除行数据对象
        this[this.clickListRow] = null;
        this[this.clickRowRadio] ='';
        if(responseData){
          this.$message({message: this.$t('statics.删除成功!'),center: true,type: 'success'});
          this.poin_initManage({"id":"searchRoleOrg",'responseFields':{},'requestFields':{'limit':'#limit'}},'afterGetUserRelations','beforGetRoleOrg')

        }else{
          this.$message({message: this.$t('statics.数据不存在/已删除!'),center: true,type: 'warning'});
        }
fukai committed
1171 1172
      //刷新当前表格
      this.$refs[this.relationTableRef].refresh();
fukai committed
1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303
      //刷新角色表格
      this.$refs.RoleRelationGrid.refresh();
      }else{
      //提示错误
      this.$message({message:responseData.errorMsg,center: true,type: 'warning'});
      }
    },
    searchChild(node, resolve){
      //渲染机构树方法
      var $this= this;
      if(node.level == 0){
        //保存顶级对象,用于再次刷新树渲染
        this.orgNode = node;
        this.orgResolve = resolve;
        //加载树的根节点
        this.poin_initManage({"id":"getOrgParentTree"},function aftert(response,responseData,messageObj){
        var treeDatas=[];
        if(response.ok){
            treeDatas = iscMessage.arrayToTree(responseData,'0','id','pid');
        }else{
            $this.$message({message: responseData.errorMsg,center: true,type: 'error'});
        }
          resolve(treeDatas);
        });
      }else{
        var nodeid = node.data.id;
        //根据id加载子节点
        this.poin_initManage({"id":"getOrgChildTree"},function aftert(response,responseData,messageObj){
          var treeDatas=[];
          if(response.ok){
            //子节点的数据处理
              treeDatas = iscMessage.arrayToTree(responseData,nodeid,'id','pid');
          }else{
              $this.$message({message: responseData.errorMsg,center: true,type: 'error'});
          }
            resolve(treeDatas);
        },function beforeGet(messageObj){
          messageObj.setUriParam({'parentid':nodeid});
        });
      }
    },
    searchDeptChild(node, resolve){
      //渲染归属部门树方法
      var $this= this;
      if(node.level == 0){
        //保存顶级对象,用于再次刷新树渲染
        this.deptNode = node;
        this.deptResolve = resolve;
        //查询顶级树节点
        this.poin_initManage({"id":"getDeptTree"},function aftert(response,responseData,messageObj){
        var treeDatas=[];
        if(response.ok){
            treeDatas = iscMessage.arrayToTree(responseData,responseData[0].pid,'id','pid');
        }else{
            $this.$message({message: responseData.errorMsg,center: true,type: 'error'});
        }
          resolve(treeDatas);
        },function beforeGet(messageObj){
          messageObj.setUriParam({'workorg':$this.user.workorg});
        });
      }else{
        var nodeid = node.data.id;
        this.poin_initManage({"id":"getDeptTreeChild"},function aftert(response,responseData,messageObj){
          var treeDatas=[];
          if(response.ok){
            //子节点的数据处理
              treeDatas = iscMessage.arrayToTree(responseData,nodeid,'id','pid');
          }else{
              $this.$message({message: responseData.errorMsg,center: true,type: 'error'});
          }
            resolve(treeDatas);
        },function beforeGet(messageObj){
          messageObj.setUriParam({'departmentNumber':nodeid});
        });
      }
    },
    searchDepartTree(node, resolve){
      //渲染部门数据树方法
      var $this= this;
      if(node.level == 0){
        this.poin_initManage({"id":"getDepartTreeA"},function aftert(response,responseData,messageObj){
        var treeDatas=[];
        if(response.ok){
            treeDatas = iscMessage.arrayToTree(responseData,responseData[0].pid,'id','pid');
        }else{
            $this.$message({message: responseData.errorMsg,center: true,type: 'error'});
        }
          resolve(treeDatas);
        });
      }else{
        var nodeid = node.data.id;
        this.poin_initManage({"id":"getDeptTreeChild"},function aftert(response,responseData,messageObj){
          var treeDatas=[];
          if(response.ok){
            //子节点的数据处理
              treeDatas = iscMessage.arrayToTree(responseData,nodeid,'id','pid');
          }else{
              $this.$message({message: responseData.errorMsg,center: true,type: 'error'});
          }
            resolve(treeDatas);
        },function beforeGet(messageObj){
          messageObj.setUriParam({'departmentNumber':nodeid});
        });
      }
    },
    addOrgBtn(tree,tables){
      //添加机构, 提交操作
      var node = this.$refs[tree].getCurrentNode();
      var $this = this;
      if(!node){
        this.$message({message: this.$t('statics.请选择完再提交!'),center: true,type: 'warning'});
      }else{
        this.poin_initManage({'id':'saveOrgUserRel'},function afterSave(response,data){
        if(response.ok){
          if(parseInt(data.orgSize) > 1){
            $this.$message({message: this.$t('statics.保存用户所属机构成功,请配置默认机构!'),center: true,type: 'warning'});
          } else {
            $this.$message({message: this.$t('statics.保存用户所属机构成功!'),center: true,type: 'success'});
          }
          $this.$refs[tables].refresh();
          $this.openOrgDialog = false;
          //add by fanyuzhe @2019-12-12 重新获取角色页签中的下拉框数据
          $this.poin_initManage({"id":"searchRoleOrg",'responseFields':{},'requestFields':{'limit':'#limit'}},'afterGetUserRelations','beforGetRoleOrg')
          //add by lujing@date2019-10-17 重置树选中
          $this.$refs[tree].store.setCurrentNodeKey(null);
          // 新增用户关联机构信息
          $this.saveRelatedOrg(node.cls,$this.userID);
        }else{
          if(data.errorMsg){
            $this.$message({message: data.errorMsg,center: true,type: 'error'});
          }
fukai committed
1304
        }
fukai committed
1305 1306 1307 1308 1309 1310 1311 1312
        },function beforSaveOrgD(messageObj){
          messageObj.setData({"departId":node.cls,"personId":$this.userID});
        })
      }
    },
    // 新增用户关联机构信息
    saveRelatedOrg(departId,personId){
      this.poin_initManage({'id':'saveInfo'},function afterSave(response,data){
fukai committed
1313

fukai committed
1314 1315 1316 1317 1318 1319 1320
      },function beforSaveOrgD(messageObj){
        messageObj.setData([{"departId":departId,"userdetailsid":personId}]);
      })
    },
    // 删除用户关联机构信息
    deleteRelatedOrg(departId,personId){
      this.poin_initManage({'id':'deleteInfo'},function afterSave(response,data){
fukai committed
1321

fukai committed
1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454
      },function beforSaveOrgD(messageObj){
        messageObj.setData({"departId":departId,"userdetailsid":personId});
      })
    },
    handleClick(tab, event) {
      if("usrRelOrg" == tab.name){
        this.$refs.usrRelOrgChild.searchTable(this.userID);
      }
      // 这里不用tab.name 是因为一旦加上tab.name,会导致页面不显示,原因未知
      if("0" == tab.paneName){
        this.checkUserInfo();
      }
    },
    // 校验用户是否为总行用户
    // checkUserInfo(){
    //   var $this = this;
    //   if($this.userID == undefined || $this.userID == ""){
    //
    //   } else {
    //     this.poin_initManage({'id':'checkUser'},function afterSave(response,data){
    //       if(response.ok){
    //         if(data){
    //           $this.isFieldDisabled = false;
    //         } else {
    //           $this.isFieldDisabled = true;
    //           $this.user.authlevel = "";
    //           $this.user.authority = "0"; // 否
    //         }
    //       }
    //     },function beforSaveOrgD(messageObj){
    //       messageObj.setUriParam({"id":$this.userID});
    //     })
    //   }
    // },
    addOrgblongBtn(tree){
      //选择归属行提交
      var node = this.$refs[tree].getCurrentNode();
      if(node){
        this.user.workorg = node.id;
        this.user.workorgName = node.text;
        //归属部门清空
        if(this.user.workDept){
          this.user.workDept = "";
          this.user.workDeptName = "";
        }
        this.openOrgDialog = false;
        //add by lujing@date2019-10-17 重置树选中
        this.$refs[tree].store.setCurrentNodeKey(null);
      }else{
        this.$message({message: this.$t('statics.请选择完再提交!'),center: true,type: 'warning'});
      }
    },
    addDeptBtn(tree){
      //归属部门提交
      var $this = this;
      var node = this.$refs[tree].getCurrentNode();
      if(node){
        $this.poin_initManage({'id':'getDepartFlag'},function afterSave(response,data){
        if(response.ok){
          if (data.flag == 0 || data.flag == 1) {
              $this.$message({message: this.$t('statics.请选择部门的节点提交!'),center: true,type: 'warning'});
              return;
            } else {
              //传递值,并关闭弹框
              $this.user.workDept = node.id;
              $this.user.workDeptName = node.text;
              $this.openDeptDialog = false;
              //add by lujing@date2019-10-17 重置树选中
              $this.$refs[tree].store.setCurrentNodeKey(null);
            }
        }else{
            $this.$message({message: data.errorMsg,center: true,type: 'error'});
        }
        },function beforS(messageObj){
            messageObj.setUriParam({"departnum" : node.id});
        });
      }else{
        this.$message({message: this.$t('statics.请选择完再提交!'),center: true,type: 'warning'});
      }
    },
    addDepartBtns(tree,tables){
      //添加部门 提交操作
      var node = this.$refs[tree].getCurrentNode();
      var $this = this;
      if(!node){
        this.$message({message: this.$t('statics.请选择完再提交!'),center: true,type: 'warning'});
      }else{
        this.poin_initManage({'id':'saveDepartRe'},function afterSave(response,responseData){
          if(response.ok){
            if (responseData.flag == 0 || responseData.flag == 1) {
              $this.$message({message: this.$t('statics.请选择一个部门!'),center: true,type: 'warning'});
              return;
            }
            $this.$message({message: this.$t('statics.保存用户部门成功!'),center: true,type: 'success'});
            $this.openDepartDialog = false;
            //add by lujing@date2019-10-17 重置树选中
            $this.$refs[tree].store.setCurrentNodeKey(null);
            $this.$refs[tables].refresh();
          }else{
            $this.$message({message:responseData.errorMsg,center: true,type: 'error'});
          }
        },function beforSaveOrgD(messageObj){
          messageObj.setData({"departId":node.id,"personId":$this.userID});
        })
      }
    },
    selectCityByPro(bol,citypam){
      //根据省份查城市
      var $this = this;
      var provinceid = this.user.province;
      if(provinceid){
        this.user.city="";
        this.poin_initManage({"id":"getCitys","responseFields":{"$cityList":{"text":"label","value":"value"}}},function after(response){
          if(response.ok && !bol &&citypam){
            $this.user.city = citypam.toString();
          }
        },function beforeGet(messageObj){
          messageObj.setUriParam({'provinceid':provinceid});
        });
      }
    },
    addGroupBtn(){
    //增加所属工作组按钮
    if(this.groupRow){
        this.groupRow = null;
        this.groupRadio = null;
      }
    var $this = this;
    $this.groupTreeData = [];
    if(this.userID == null){ 
        this.$message({message: this.$t('statics.请先保存用户信息!'),center: true,type: 'warning'});
      }else{
        this.poin_initManage({"id":"selectGroupTree"},function afterG(response,responseData){
fukai committed
1455
          if(response.ok){
fukai committed
1456
          $this.groupTreeData = iscMessage.arrayToTree(responseData,'0');
fukai committed
1457 1458 1459 1460 1461
          }else{
            if(responseData.errorMsg){
              $this.$message({message: responseData.errorMsg,center: true,type: 'error'});
            }
          }
fukai committed
1462 1463
        },function beforeGet(messageObj){
            messageObj.setUriParam({'userid':$this.userID});
fukai committed
1464
        });
fukai committed
1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475
      this.openGroupDialog = true;
    }
    },
    addGroupBtns(tree,tables){
    //添加工作组提交操作
      var node = this.$refs[tree].getCurrentNode();
      var $this = this;
      if(!node){
        this.$message({message: this.$t('statics.请选择完再提交!'),center: true,type: 'warning'});
      }else{
        this.poin_initManage({'id':'submitGroup'},function afterSave(response,responseData){
fukai committed
1476
          if(response.ok){
fukai committed
1477 1478 1479 1480 1481
            $this.$message({message: this.$t('statics.保存工作组成功!'),center: true,type: 'success'});
            $this.$refs[tables].refresh();
            $this.openGroupDialog = false;
            //add by lujing@date2019-10-17 重置树选中
            $this.$refs[tree].store.setCurrentNodeKey(null);
fukai committed
1482 1483 1484 1485 1486
          }else{
            if(responseData.errorMsg){
              $this.$message({message: responseData.errorMsg,center: true,type: 'error'});
            }
          }
fukai committed
1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508
        },function beforSaveOrgD(messageObj){
          messageObj.setData({"groupId":node.id,"personId":$this.userID});
        })
      }
    },
    addPostBtn(){
    //增加岗位 按钮
    if(this.postRow){
        this.postRow = null;
        this.postRadio = null;
      }
    var $this = this;
    $this.postTreeData = [];
    if(this.userID == null){
        this.$message({message: this.$t('statics.请先保存用户信息!'),center: true,type: 'warning'});
      }else{
        this.poin_initManage({"id":"selectPostTree"},function afterG(response,responseData){
          if(response.ok){
            $this.postTreeData = iscMessage.arrayToTree(responseData,'0');
          }else{
            $this.$message({message: responseData.errorMsg,center: true,type: 'error'});
          }
fukai committed
1509
        },function beforeGet(messageObj){
fukai committed
1510
          messageObj.setUriParam({'userid':$this.userID});
fukai committed
1511
        });
fukai committed
1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532
      this.openPostDialog = true;
    }
    },
    addPostBtns(tree,tables){
      //添加岗位 提交操作
      var node = this.$refs[tree].getCurrentNode();
      var $this = this;
      if(!node){
        this.$message({message: this.$t('statics.请选择完再提交!'),center: true,type: 'warning'});
      }else{
        this.poin_initManage({'id':'submitPost'},function afterSave(response,responseData){
          if(response.ok){
            $this.$message({message: this.$t('statics.保存用户岗位成功!'),center: true,type: 'success'});
            $this.openPostDialog = false;
            //add by lujing@date2019-10-17 重置树选中
            $this.$refs[tree].store.setCurrentNodeKey(null);
            $this.$refs[tables].refresh();
          }else{
            if(responseData.errorMsg){
              $this.$message({message: responseData.errorMsg,center: true,type: 'error'});
            }
fukai committed
1533
          }
fukai committed
1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558
        },function beforSaveOrgD(messageObj){
          messageObj.setData({"postId":node.id,"personId":$this.userID});
        })
      }
    },
    addRoleBtn(){
    if(this.roleRow){
        this.roleRow = null;
        this.roleRadio = null;
      }
    //增加角色按钮
      var $this = this;
      if(this.userID == null){
        this.$message({message: this.$t('statics.请先保存用户信息!'),center: true,type: 'warning'});
      }else{
        if('10230' == JSON.parse(window.sessionStorage.curRole).id){
          this.poin_initManage({"id":"selectRoletree"},function afterG(response,responseData){
            if(response.ok){
              $this.RoleTreeData = iscMessage.arrayToTree(responseData,'0');
            }else{
              if(responseData.errorMsg){
                $this.$message({message: responseData.errorMsg,center: true,type: 'error'});
              }
            }
          });
fukai committed
1559
        } else {
fukai committed
1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570
          this.poin_initManage({"id":"selectSubRoletree"},function afterG(response,responseData){
            if(response.ok){
              $this.RoleTreeData = iscMessage.arrayToTree(responseData, JSON.parse(window.sessionStorage.curRole).parentRoleId);
            }else{
              if(responseData.errorMsg){
                $this.$message({message: responseData.errorMsg,center: true,type: 'error'});
              }
            }
          },function beforeGet(messageObj){
              messageObj.setUriParam({'currentLoginUserRoleId':JSON.parse(window.sessionStorage.curRole).id});
          });
fukai committed
1571
        }
fukai committed
1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599
        this.openRoleDialog = true;
      }
    },
    addRoleBtns(tree,tables){
      //添加角色 提交操作
      var node = this.$refs[tree].getCurrentNode();
      var $this = this;
      if(!node){
        this.$message({message: this.$t('statics.请选择完再提交!'),center: true,type: 'warning'});
      }else{
        this.poin_initManage({'id':'submitRole'},function afterSave(response,responseData){
          if(response.ok){
            if(parseInt(responseData.roleSize) > 1){
              $this.$message({message: this.$t('statics.保存用户角色成功,请配置默认角色!'),center: true,type: 'warning'});
            } else {
              $this.$message({message: this.$t('statics.保存用户角色成功!'),center: true,type: 'success'});
            }
            $this.openRoleDialog = false;
            //add by lujing@date2019-10-17 重置树选中
            $this.$refs[tree].store.setCurrentNodeKey(null);
            $this.$refs[tables].refresh();
          }else{
            if(responseData.errorMsg){
              $this.$message({message: responseData.errorMsg,center: true,type: 'error'});
            }
          }
        },function beforSaveOrgD(messageObj){
          messageObj.setData(JSON.stringify({"roleId":node.id,"personId":$this.userID}));
fukai committed
1600
        })
fukai committed
1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674
      }
    },
    clickOrgRow(row){
      //点击机构列表行
      this.orgRadio = this.OrgGridList.indexOf(row);
      this.orgRow = row;
    },
    clickDepartRow(row){
      //点击部门列表行
      this.departRadio = this.DepartGridList.indexOf(row);
      this.departRow = row;
    },
    clickGroupRow(row){
      //点击工作组列表行
      this.groupRadio = this.GroupGridList.indexOf(row);
      this.groupRow = row;
    },
    clickPostRow(row){
      //点击岗位列表行
      this.postRadio = this.PostGridList.indexOf(row);
      this.postRow = row;
    },
    clickRoleRow(row){
      //点击角色列表行
      this.roleRadio = this.RoleGridList.indexOf(row);
      this.roleRow = row;
    },
    validatePass2(rule, value, callback){
      if (value === '') {
            callback(new Error(this.$t('statics.请再次输入密码')));
          } else if (value !== this.user.logPass) {
            callback(new Error(this.$t('statics.两次输入密码不一致')));
          } else {
            callback();
          }
    },
    changePassW(){
      this.user.logPass="";
      this.setPassWord = true;
      this.$notify.warning({
        title: this.$t('statics.提示'),
        message: this.$t('statics.请重新输入密码之后点击‘提交’!')
      });
    },
    goBack(){
      //this.$router.push({name:'userSearch'});
      this.routerPush({
            path: '/iscOrganization/userManage'
          })
      this.$parent.$refs.userTable.refresh();
    },
    //add by lujing 关闭弹出框和取消按钮,重置树选中节点
    closeAndResetTree(close,tree){
      //add by lujing@date2019-10-17 重置树选中
      this[close]= false;
      var node = this.$refs[tree].getCurrentNode();
      if(node){
        this.$refs[tree].store.setCurrentNodeKey(null);
      }
    },
    confirmEdit(index, row, ref) {
      this.RoleGridList[index].priority = this.editPriority;
      this.$refs[ref].doClose();
    },
    cancelEdit(ref) {
      this.$refs[ref].doClose();
    },
    editColumn(index, row) {
      this.editPriority = row.priority;
    }
  },
  beforeDestroy() {
    this.$parent.hideChild = true;
  }
fukai committed
1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703
}
</script>
<style type="text/css" lang="less">
.userD-mag{
 .requireds .el-form-item__label:before{
    content: '*';
    color: #f56c6c;
    margin-right: 4px;
   }
	.el-form .subBtn>.el-button{
	margin-right:50px
}
	.dialog-tree{
	height:410px;
	overflow: auto;
 }
 .el-table__row{
	 a{
		color: #000;
		text-decoration: none;
		border-bottom: dashed 1px #0088cc;
	}
 }
 .fontdashed {
	 cursor:pointer;
	 border-bottom: dashed 1px #0088cc;
 }
}
</style>