index.vue 8.68 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 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
<template>
  <div class="eContainer">
    <c-page title="进口信用证提货担保">
      <el-form
        :model="model"
        :rules="rules"
        ref="modelForm"
        label-width="180px"
        label-position="right"
        size="small"
        :validate-on-rule-change="false">
        <c-tabs v-model="tabVal" ref="elment" type="card" @tab-click="tabClick">
          <!--PD000057 提货担保-->
          <el-tab-pane label="业务信息" name="ovwp">
            <c-content>
              <m-ovwp :model="model" :codes="codes" />
            </c-content>
          </el-tab-pane>

          <el-tab-pane label="保证金" name="ccvpan">
            <c-content>
              <m-ccvpan :codes="codes" :isAdjustCshpct="true" :model="model" />
            </c-content>
          </el-tab-pane>

          <el-tab-pane label="表外信息" name="engp">
            <c-content>
              <m-engp :codes="codes" :model="model" />
            </c-content>
          </el-tab-pane>

          <!--PD000027 -->
          <el-tab-pane label="费用/账务" name="setpan">
            <c-content>
              <m-setmod :model="model" :codes="codes" />
            </c-content>
          </el-tab-pane>

          <!--PD000001 -->
          <el-tab-pane label="备查/附言" name="addbcb">
            <c-content>
              <m-addbcb :model="model" :codes="codes" />
            </c-content>
          </el-tab-pane>

          <!--PD000529 -->
          <el-tab-pane label="报文/面函" name="docpan">
            <c-content>
              <m-docpan :model="model" :codes="codes" />
            </c-content>
          </el-tab-pane>
        </c-tabs>
      </el-form>
      <c-function-btn
        :handleCheck="handleCheck"
        :handleStash="handleStash"
        :handleSubmit="handleSubmit"
        @handleSureWarning="handleSureWarning"
        ref="commonBtn"></c-function-btn>
      <el-dialog
        v-dialogDrag
        title="通知到单数据"
        :visible.sync="isDialogVisiable"
        width="60%"
        v-if="isDialogVisiable"
        @close="handleClose">
        <c-table
          :list="advDataArray"
          :columnsConfig="columns"
          :paginationShow="true"
          :total="advDataArray.length"
          @row-dblclick="pickDepItem">
          <el-table-column prop="op" label="OP" width="80" fixed="right">
            <template slot-scope="scope">
              <c-button style="margin-left: 0" size="small" type="primary" @click="pickDepItem(scope.row)">
                选择
              </c-button>
            </template>
          </el-table-column>
        </c-table>
      </el-dialog>
    </c-page>
  </div>
</template>
<script>
import Api from "~/service/Api";
import CodeTable from "~/config/CodeTable";
import Litrog from "../model";
import check from "../model/check";
import operationFunc from "~/mixin/operationFunc";
import event from "../event";
import Ovwp from "./Ovwp";
import Ccvpan from "~/components/business/ccvpan/views";
import Engp from "~/components/business/engp/views";
import Addbcb from "./Addbcb";
import Coninfp from "~/components/business/coninfp/views";
import Docpan from "~/components/business/docpan/views";
import Doctre from "~/components/business/doctre/views";
import Setmod from "~/components/business/setmod/views";
import Glentry from "~/components/business/glentry/views";
import buildFn from "../event/buildCommons.js";
import Default from "../model/default";
import commonDepend from "~/mixin/commonDepend";

export default {
  name: "Litrog",
  components: {
    "m-coninfp": Coninfp,
    "m-docpan": Docpan,
    "m-doctre": Doctre,
    "m-addbcb": Addbcb,
    "m-setmod": Setmod,
    "m-glentry": Glentry,
    "m-ovwp": Ovwp,
    "m-ccvpan": Ccvpan,
    "m-engp": Engp,
  },
  provide() {
    return {
      root: this,
    };
  },
  mixins: [operationFunc, event, buildFn, commonDepend, Default, check], // 里面包含了Default、Check等的公共处理
  data() {
    return {
      tabVal: "ovwp",
      trnName: "litrog",
      model: new Litrog().data,
      codes: { ...CodeTable },
      activeNames: ["engp"],
      isDialogVisiable: false,
      advDataArray: [],
      columns: [
        {
          label: "INR",
          prop: "inr",
          width: 150,
        },
        {
          label: "Reference",
          prop: "ownref",
          width: 180,
        },
        {
          label: "Name",
          prop: "nam",
          width: 180,
        },
        {
          label: "Date",
          prop: "credat",
          width: 150,
        },
        {
          label: "Maturity",
          prop: "matdat",
          width: 150,
        },
        {
          label: "ADVDOCFLG",
          prop: "advdocflg",
          width: 150,
        },
        {
          label: "ETYEXTKEY",
          prop: "etyextkey",
          width: 150,
        },
        {
          label: "BCHKEYINR",
          prop: "bchkeyinr",
          width: 150,
        },
        {
          label: "BRANCHINR",
          prop: "branchinr",
          width: 150,
        },
        {
          label: "NGRCOD",
          prop: "ngrcod",
          width: 150,
        },
        {
          label: "SGDINR",
          prop: "sgdinr",
          width: 150,
        },
        {
          label: "BLNUM",
          prop: "blnum",
          width: 150,
        },
        {
          label: "SHGREF",
          prop: "shgref",
          width: 150,
        },
        {
          label: "GUAFLG",
          prop: "guaflg",
          width: 150,
        },
        {
          label: "TENMAXDAY",
          prop: "tenmaxday",
          width: 150,
        },
        {
          label: "STADAT",
          prop: "stadat",
          width: 150,
        },
        {
          label: "RPTREF",
          prop: "rptref",
          width: 150,
        },
        {
          label: "INVREF",
          prop: "invref",
          width: 150,
        },
        {
          label: "PRECHKDAT",
          prop: "prechkdat",
          width: 150,
        },
        {
          label: "ISCHKTYP",
          prop: "ischktyp",
          width: 150,
        },
        {
          label: "CFABRTFLG",
          prop: "cfabrtflg",
          width: 150,
        },
        {
          label: "CFABRTTXT",
          prop: "cfabrttxt",
          width: 150,
        },
        {
          label: "INVTYP",
          prop: "invtyp",
          width: 150,
        },
        {
          label: "OPPNAM",
          prop: "oppnam",
          width: 150,
        },
      ],
    };
  },
  methods: {
    initData(params) {
      this.init(params);
    },
    pickDepItem(row) {
      this.isDialogVisiable = false;
      // 通过选中数据加载交易
      let params = {
        transName: this.trnName,
        lidgrp: {
          rec: {
            inr: this.$route.query.inr,
          },
        },
        brdgrp: {
          rec: {
            inr: row.inr,
          },
        },
      };
      this.initData(params);
    },
    handleClose() {
      this.$alert(
        "An existing contract is required to execute this transaction.\nEither no contract was passed or the passed contract is deleted.\nThe transaction cannot be executed. Please install the contract first.",
        "警告",
        {
          confirmButtonText: "OK",
        }
      ).then(async () => {
        this.$store.commit("delTagsArry", this.$route.path);
        this.$router.back();
      });
    },
  },
  mounted() {
    console.log("进入litrog交易");
    this.queryAdvData(this.$route.query.inr).then((result) => {
      this.advDataArray = result;
      if (this.advDataArray.length > 0) {
        // 有则提示是否选通知到单数据处理
        this.$confirm(
          "For this L/C some document sets have been advised while\nthe documents have not been received.  Do you want to select\none of those document sets to process their receipt ?",
          "提示",
          {
            confirmButtonText: "OK",
            cancelButtonText: "Cancel",
            type: "warning",
          }
        )
          .then(async () => {
            // 是则弹出到单数据
            this.isDialogVisiable = true;
          })
          .catch(() => {
            // 否则直接进入交易
            let params = {
              transName: this.trnName,
              lidgrp: {
                rec: {
                  inr: this.$route.query.inr,
                },
              },
            };
            this.initData(params);
          });
      } else {
        // 没有通知到单数据则直接初始化
        let params = {
          transName: this.trnName,
          lidgrp: {
            rec: {
              inr: this.$route.query.inr,
            },
          },
        };
        this.initData(params);
      }
    });
  },
};
</script>
<style></style>