ActInfo.vue 13.8 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
<template>
  <div class="eibs">
    <el-form
        ref="modelForm"
        label-width="170px"
        size="small"
        label-position="right"
        :model="act"
        :rules="rules"
        :validate-on-rule-change="false"
        :disabled="operate === 'details'"
      >
      <c-col :span="12" class="col-left">
        <c-col :span="24">
          <el-form-item label="所属客户编号" prop="ptyextkey">
            <c-fullbox>
              <c-input :disabled="true" v-model="act.ptyextkey" placeholder="请输入账号"> </c-input>
              
              <template slot="footer" v-if="operate === 'add'">
                <c-button
                  style="margin: 0 0 0 10px; padding: 0 12px"
                  size="small"
                  type="primary"
                  @click="getBaseData_0208(act.ptyextkey)"
                >
                  获取
                </c-button>
              </template>
            </c-fullbox>

            <!--c-input v-model="act.ptyextkey" style="width: 100%" placeholder="请输入所属客户编号" :disabled=true> </c-input-->
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="账号" prop="extkey">
            <c-fullbox>
              <c-input :disabled="operate === 'edit'" v-model="act.extkey" placeholder="请输入账号"> </c-input>
              
niewei committed
39
              <template slot="footer" v-if="operate === 'add'">
fukai committed
40 41 42 43 44 45 46 47
                <c-button
                  style="margin: 0 0 0 10px; padding: 0 12px"
                  size="small"
                  type="primary"
                  @click="getBaseData(act.ptyextkey)"
                >
                  获取
                </c-button>
niewei committed
48
              </template>
fukai committed
49

niewei committed
50
              <!--
fukai committed
51 52 53 54 55 56 57 58 59
              <template slot="footer"  >
                <c-button
                  style="margin: 0 0 0 10px; padding: 0 12px"
                  size="small"
                  type="primary"
                  @click="getBaseData_8023_8091(act.extkey)"
                >
                  获取
                </c-button>
niewei committed
60
              </template>-->
fukai committed
61 62 63 64 65 66 67 68 69 70 71 72

            </c-fullbox>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="账号类型" prop="typ">
            <c-select v-model="act.typ" ref="typ" @change="typChange"  style="width: 100%" placeholder="请选择账号类型" dbCode="ACTTYP" :filterKey="act_typ" :isShowKeyAndLabel="true" filterable> </c-select>
          </el-form-item>
        </c-col>
        
        <c-col :span="24" v-if="operate != 'details'">
          <el-form-item label="核心业务代号" prop="acccore" v-if="operate !== 'details'">
niewei committed
73
            <c-input v-model="act.acccore" placeholder="请输入核心业务代号" :disabled=false> </c-input>
fukai committed
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 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="科目类型" prop="trmtyp">
            <el-select
              v-model="act.trmtyp" clearablex
              placeholder="请选择科目类型"
              :isShowKeyAndLabel="true" 
              filterable
            >
              <el-option v-for="item in trmtyplst" :key="item.trmtyp" :label="act.typ+' - '+item.trmcod+' '+item.nam"
                        :value="item.trmtyp">
                <span >{{ act.typ+' - '+item.trmcod+' '+item.nam}}</span>
                
              </el-option>
            </el-select>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="账号性质" prop="actpro">
            <!-- :disabled="true" -->
            <c-select v-model="act.actpro" placeholder="请输入账号性质" :disabled="true" dbCode="ACTPRO" :isShowKeyAndLabel="true" filterable> </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="借记贷记" prop="dirflg">
            <c-select v-model="act.dirflg" placeholder="请输入借记贷记" dbCode="DIRFLG"> </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="头寸账户标志" prop="cvrflg">
            <c-radio-group v-model="act.cvrflg">
              <el-radio label="Y"></el-radio>
              <el-radio label=""></el-radio>
            </c-radio-group>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="所属客户账号" prop="holacc">
            <c-input v-model="act.holacc" placeholder="请输入所属客户账号"> </c-input>
          </el-form-item>
        </c-col>
      </c-col>
      <c-col :span="12" class="col-right">
        <c-col :span="24">
          <el-form-item label="客户名称" prop="ptynam">
            <c-input v-model="act.ptynam" style="width: 100%" placeholder="请输入客户名称" :disabled="true"> </c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="账号描述" prop="nam">
            <c-input v-model="act.nam" placeholder="请输入账号描述"> </c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="币种" prop="cur" >
niewei committed
130 131 132
            <!-- <c-select v-model="act.cur" ref="cur" @change="curChange" placeholder="请输入币种" dbCode="CURTXT" :isCache="false" :isShowKeyAndLabel="true" filterable :disabled="!(act.extkey.startsWith('FT') || act.extkey.startsWith('EF'))"> </c-select> -->
            <c-select v-model="act.cur" ref="cur" @change="curChange" placeholder="请输入币种" dbCode="CURTXT" :isCache="false" :isShowKeyAndLabel="true" filterable 
            :disabled=false> </c-select>
fukai committed
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 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 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 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 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
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="主账户" prop="zmqacc" :required="!accflg">
            <c-input v-model="act.zmqacc" placeholder="请输入主账户" :disabled="accflg"> </c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="账户类型" prop="acctyp">
            <!-- :disabled="true" -->
            <c-select v-model="act.acctyp"  :disabled="true" placeholder="请输入账户类型" dbCode="ACCTPE" :isShowKeyAndLabel="true" filterable > </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="优先级" prop="pri">
            <c-select v-model="act.pri" placeholder="请选择优先级" dbCode="ACTPRI" :isShowKeyAndLabel="true" filterable> </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="逻辑删除状态" prop="delflg">
            <c-radio-group v-model="act.delflg">
              <el-radio label="X">已删除</el-radio>
              <el-radio label="">已启用</el-radio>
            </c-radio-group>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="偿付账户标志" prop="rmbflg">
            <c-radio-group v-model="act.rmbflg">
              <el-radio label="Y"></el-radio>
              <el-radio label=""></el-radio>
            </c-radio-group>
          </el-form-item>
        </c-col>
      </c-col>
      <c-col :span=24>
        <c-col :span=12>
          <c-col :span="24">
            <el-form-item label="一般提示信息" prop="inflev">
              <c-select v-model="act.inflev" placeholder="请选择一般提示信息" dbCode="INFLEV"> </c-select>
            </el-form-item>
          </c-col>
          <c-col :span="24">
            <el-form-item label="" prop="inftxt" v-if="act.inflev">
              <c-input 
                type="textarea" 
                :rows="4" 
                v-model="act.inftxt" 
                maxlength="150" 
                show-word-limit 
                placeholder="请输入提示信息内容"
              ></c-input>
            </el-form-item>
          </c-col>
        </c-col>
        <c-col :span=12>
          <c-col :span="24">
            <el-form-item label="停用提示信息" prop="stpinflev">
              <c-select v-model="act.stpinflev" placeholder="请选择停用提示信息" dbCode="INFLEV"> </c-select>
            </el-form-item>
          </c-col>
          <c-col :span="24">
            <el-form-item label="" prop="stpinftxt" v-if="act.stpinflev">
              <c-input 
                type="textarea" 
                :rows="4" 
                v-model="act.stpinftxt" 
                maxlength="150" 
                show-word-limit 
                placeholder="请输入停用提示信息内容"
              ></c-input>
            </el-form-item>
          </c-col>
        </c-col>
      </c-col>
    </el-form>
  </div>
</template>

<script>
import { Pattern } from "./Actjs/Act.js";
import codes from "~/config/CodeTable";
import { getWebDetail, getTrmtyp } from "~/service/manage/act.js";

export default {
  inject: ["root"],
  name: "",
  props: ['act', 'operate', 'model'],
  data() {
    return {
      rules: Pattern,
      baseList: [],
      baseDialog: false,
      trmtyplst: [],
      curLable:"",
      typLabel:"",
    };
  },
  components: {
  },
  created() {
    if(this.act.typ) {
      this.getTrmtyp(this.act.typ,this.act.ptyextkey, this.model.branchcode)
    }
    if(this.act.cur) {
      this.curChange()
    }
  },
  watch: {
    "act.typ": {
      handler(newVal){
        this.getTrmtyp(newVal,this.act.ptyextkey, this.model.branchcode)
      },
    },
    "act.cur": {
      handler(newVal) {
        console.log("newVal", newVal)
        this.curChange(newVal)
      }
    },
    "act.trmtyp": {
      handler(newVal) {
        let obj = {
          actdata: this.act,
          trmtyplist: this.trmtyplst
        }
        this.$emit("checkIllegal", obj)
      }
    }
  },
  computed: {
    accflg() {
      var acc = this.act.extkey;
      if (acc) {
        var id1 = acc.indexOf('ZMQ')
        var id2 = acc.indexOf('FT')
        var id3 = acc.indexOf('EF')
        if (id1 == 0 || id2 == 0 || id3 == 0) {
          return false
        }
      }
      return true
    },

    act_typ(){
      let typ=[];
      
        let currentOrg=this.$store.state.UserContext.currentOrg;
        if (currentOrg){
          console.log("currentOrg-->-",currentOrg)
          if (currentOrg.level !=='0' && currentOrg.level !==0){
            typ=['AS','CC','FI','LO'];
          }
        }
      
      console.log("--->--", typ)
      return typ;
    },
   


  },
  methods: {
    
    curChange(value){
      let obj = {};
      console.log("this.$refs.cur", this.$refs.cur)
      console.log("this.act.cur", this.act.cur)
      obj = this.$refs.cur.dbCodeList.find((item)=>{
        console.log(item.value)
        return item.value === this.act.cur;
      });
      
      console.log("this.act.typ", this.act.typ)
      console.log("objjjj", obj)
      this.curLabel=obj.label;
      console.log("objjjj", obj)

      obj = {};
      if (this.$refs.typ && this.act.typ) {
        obj = this.$refs.typ.dbCodeList.find((item)=>{
          return item.value === this.act.typ;
        });
        this.typLabel=obj.label;

        let actnam=(this.curLabel + this.typLabel + "," + this.act.ptyextkey);
        if (actnam.length > 40){
          this.act.nam = actnam.substring(0,40)
        }else {
          this.act.nam = actnam
        }
      } else {
        let actnam = this.curLabel + "," + this.act.ptyextkey;
        this.act.nam = actnam
      }
      
    },

    typChange(value){
      let obj = {};
      obj = this.$refs.typ.dbCodeList.find((item)=>{
        return item.value === value;
      });
      this.typLabel=obj.label;

      obj = {};
      if (this.$refs.cur && this.act.cur) {
        obj = this.$refs.cur.dbCodeList.find((item)=>{
          return item.value === this.act.cur;
        });
        this.curLabel=obj.label;

        let actnam=(this.curLabel + this.typLabel + "," + this.act.ptyextkey);
        if (actnam.length>40){
          this.act.nam=actnam.substring(0,40);
        }else {
          this.act.nam=actnam;
        }
      } else {
        let actnam = this.typLabel + "," + this.act.ptyextkey;
        this.act.nam = actnam
      }
      
    },
    getTrmtyp(typ,ptyextkey, branchcode) {
      getTrmtyp({"acctyp":typ,"ptyextkey":ptyextkey, "branchcode": branchcode}).then((res) => {
        if(res.respCode == "AAAAAA") {
          this.$set(this, "trmtyplst", res.data)
        } else {
          this.$notify.error(res.respMsg)
        }
      })
    },
    getBaseData_0208(ptyextkey) {
      if (ptyextkey === ""||ptyextkey.length<10){
        this.$message.info("请输入10位客户号!")
      }
      let parms={"ptyextkey":ptyextkey,"startnum":"1","selectnum":"80"}
      this.$emit('queryWebInfo', parms)
    },

    //修改页面--点击获取
    getBaseData_8023_8091(extkey) {
      if (extkey === ""||extkey === null){
        this.$message.info("请输入账号!")
        return 0;
      };

      let params = {
        extkey: extkey
      };

    getWebDetail(params).then((res) => {
      if (res.respCode == SUCCESS||res.respCode == "BBBBBB") {
        this.act.acccore = res.data.acccore;
        this.act.actpro = res.data.actpro;
        this.act.cur = res.data.cur;
        if ( !this.act.cur ){
          if (this.act.extkey.startsWith('FT')||this.act.extkey.startsWith('EF')){
            this.act.cur="CNY" 
          }
        }

        if(res.respCode == SUCCESS){
          this.$notify.success(res.respMsg)
        }else{
          this.$message.info(res.respMsg)
        }
      } else if(res.respCode == "BBBBBB"){
        //this.$message.info(res.respMsg);
      }else if(res.respCode == "EEEEEE"){
        this.$notify.error(res.respMsg);
      }
    })
    .catch((err) => {
      this.$notify.error("获取核心账号信息异常")
    });

},

    cancel() {
      this.handleClose();
    },
    handleClose(done) {
      this.baseDialog = false;
      if (done && typeof done === "function") {
        done();
      }
    },
  },
};
</script>

<style>
</style>