OcrmInfo.vue 6.62 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 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 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
<template>

  <div class="eibs-tab">
    <c-col :span="12" class="col-left">
      <c-col :span="24">
        <c-fullbox>
          <el-form-item label="外汇客户类别" prop="crmtyp">
            <c-select dbCode="CRMTYP" v-model="model.crmtyp" :isShowKeyAndLabel="true" filterable clearable :disabled=true> </c-select>
          </el-form-item>   
          <template slot="footer">
            <c-button
              style="margin: 0 0 0 10px; padding: 0 12px"
              size="small"
              type="primary"
              :disabled="!model.extkey || type == 'info'"
              @click="getInfoFromCRM(model.extkey)">
                获取
            </c-button>
          </template>
        </c-fullbox>
      </c-col>

      <c-col :span="24">
        <el-form-item label="状态">
          <c-select dbCode="CRMSTA" v-model="ptycrm.crmSta" :isShowKeyAndLabel="true" filterable clearable  :disabled=true> </c-select>
        </el-form-item>
      </c-col>
    </c-col>
    <c-col :span="12" class="col-right">
      <c-col :span="24">
        <el-form-item label="可信客户分类">
          <c-select dbCode="CREDIT" v-model="ptycrm.creditSort" :isShowKeyAndLabel="true" filterable clearable :disabled=true> </c-select>
        </el-form-item>   
      </c-col>
      <c-col :span="24">
        <el-form-item label="认定日期">
          <c-date-picker v-model="model.khbsdt" value-format="yyyy-MM-dd" :disabled=true> </c-date-picker>
        </el-form-item>
      </c-col>
    </c-col>
    <c-col :span="24" v-if="ptycrm.creditSort == '3'">
      <c-col :span="12" class="col-left">
        <c-col :span="24">
          <el-form-item label="退汇单笔最大金额(美元)">
          	<c-input-currency v-model="ptycrm.refremitMaxBal" disabled :currency="'USD'"></c-input-currency>
            <!-- <c-input v-model="ptycrm.refremitMaxBal" :disabled=true> </c-input> -->
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="服务贸易单笔最大金额(美元)">
            <c-input-currency v-model="ptycrm.sertradeMaxBal" disabled :currency="'USD'"></c-input-currency>
            <!-- <c-input v-model="ptycrm.sertradeMaxBal" :disabled=true> </c-input> -->
          </el-form-item>
        </c-col>
      </c-col>
      <c-col :span="12" class="col-right">
        <c-col :span="24">
          <el-form-item label="货物贸易单笔最大金额(美元)">
            <c-input-currency v-model="ptycrm.gootradeMaxBal" disabled :currency="'USD'"></c-input-currency>
            <!-- <c-input v-model="ptycrm.gootradeMaxBal"  :disabled=true> </c-input> -->
          </el-form-item>
        </c-col>

      </c-col>
    </c-col>
    <c-col :span="24">
      <el-form-item label="适用类型" style="width: 100%">
        <el-checkbox-group  v-model="checkedList"  :disabled=true>
          <el-checkbox :key="sta.value" :label="sta.value" class="el-checkbox-width" v-for="sta in businessList">{{sta.label}}
          </el-checkbox>
        </el-checkbox-group>
      </el-form-item>
     </c-col>
  </div>
</template>

<script>
import codes from "~/config/CodeTable";
import Api from "~/service/Api";
// import Ptycrm from './PtycrmModel.js';

export default {
  name: "",
  props: ["model", "ptycrm","type"],
  data() {
    return {
      businessList: [
        { label: "货物贸易", value: "01" },
        { label: "服务贸易", value: "02" },
        { label: "收益与经常转移", value: "03" },
        { label: "境外直接投资", value: "04" },
        { label: "境内直接投资", value: "05" },
        { label: "跨境担保", value: "06" },
        { label: "企业境外放款", value: "07" },
        { label: "外债", value: "08" },
        { label: "境外贷款", value: "09" },
        { label: "国际贸易融资", value: "10" }
      ],
      first:true,
      checkedList:[]
    };
  },
  mounted() {},
  created() {},
  computed: {},
  methods: {
    init(){
      if (this.first){
        this.getInfoFromDB(this.model.inr);
        this.first = false;
      }
    },
    getInfoFromDB(ptyinr){
      let data={
        "ptyinr": ptyinr
        };
      Api.post('/manager/ptycrm/getInfoFromDB',data).then(res => {
        if (res.respCode == SUCCESS) {
          this.ptycrm.ptyinr=ptyinr;
          this.ptycrm.creditSort=res.data.creditSort;
          this.ptycrm.crmSta = res.data.crmSta;
          this.ptycrm.business = res.data.business;
          this.ptycrm.refremitMaxBal = res.data.refremitMaxBal;
          this.ptycrm.gootradeMaxBal = res.data.gootradeMaxBal;
          this.ptycrm.sertradeMaxBal = res.data.sertradeMaxBal;
          if(res.data.business){
            this.checkedList = res.data.business.split(",")
          } else {
            this.checkedList = [];
          }
          console.log("res.data:",JSON.stringify(res.data));
          console.log("res.data:",JSON.stringify(this.ptycrm))
        } else {
          this.$notify.error({
            	title: '错误:',
              message: res.data.msg,
              dangerouslyUseHTMLString: true 
            });
        }
      }).catch((err) => {
        this.$notify.error("查询OCRM客户信息失败")
      });
    },

    getInfoFromCRM(extkey){
       let data={
        "extkey": extkey
        };
      Api.post('/manager/ptycrm/getInfoFromCRM',data).then(res => {
        if (res.respCode == SUCCESS) {
          this.ptycrm.ptyinr = this.model.inr;
          this.model.crmtyp = res.data.crmtyp;
          if (res.data.khbsdt) {
            this.model.khbsdt = res.data.khbsdt.substr(0,4)+"-"+res.data.khbsdt.substr(4,2)+"-"+res.data.khbsdt.substr(6,2)
          } else {
            this.model.khbsdt = "";
          }
          this.ptycrm.creditSort=res.data.ptycrm.creditSort;
          this.ptycrm.crmSta = res.data.ptycrm.crmSta;
          this.ptycrm.business = res.data.ptycrm.business;
          this.ptycrm.refremitMaxBal = res.data.ptycrm.refremitMaxBal;
          this.ptycrm.gootradeMaxBal = res.data.ptycrm.gootradeMaxBal;
          this.ptycrm.sertradeMaxBal = res.data.ptycrm.sertradeMaxBal;
          if(res.data.ptycrm.business){
            this.checkedList = res.data.ptycrm.business.split(",")
          } else {
            this.checkedList = [];
          }
        } else {
          this.$notify.error({
            	title: '错误:',
              message: res.data.msg,
              dangerouslyUseHTMLString: true 
            });
        }
      }).catch((err) => {
        this.$notify.error("查询OCRM客户信息失败")
      });
    }
  }
};
</script>

<style lang="less" scoped>
  .el-checkbox-width {
    margin-right: 0px;
    float: left;
    text-align: left !important;
    width: 150px;
  }
</style>