index.vue 9.01 KB
Newer Older
liuxiaojing 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
<template>
  <c-page title="汇出汇款">
    <div class="eContainer">
      <el-form :model="model" ref="modelForm" :rules="rules" label-position="left" label-width="150px" size="small">
        <el-tabs v-model="activeName" type="card" @tab-click="onTabClick">

          <!-- 概况 -->
          <el-tab-pane label="概况" name="basic">
            <m-basic
              v-bind:model="model"
              v-bind:codes="codes" />
          </el-tab-pane>

          <!-- 报文 -->
          <el-tab-pane v-if="baowenType === 'Mt103'" label="报文" name="mt103">
            <m-mt103
              v-bind:model="model"
              v-bind:codes="codes" />
          </el-tab-pane>
          <el-tab-pane v-else-if="baowenType === 'Fmt100'" label="报文" name="fmt100">
            <m-fmt100
              v-bind:model="model"
              v-bind:codes="codes" />
          </el-tab-pane>
          <el-tab-pane v-else-if="baowenType === 'Cmt100'" label="报文" name="cmt100">
            <m-cmt100
              v-bind:model="model"
              v-bind:codes="codes" />
          </el-tab-pane>
           <template v-else-if="baowenType === '103202'">
            <el-tab-pane label="报文信息(103)" name="mt103">
              <m-mt103
                v-bind:model="model"
                v-bind:codes="codes" />
            </el-tab-pane>
            <el-tab-pane label="报文信息(202)" name="mt202">
              <m-mt202
                v-bind:model="model"
                v-bind:codes="codes" />
            </el-tab-pane>
          </template>

          <!-- 费用 -->
          <el-tab-pane label="费用" name="fee">
45 46 47
            <m-fee
              v-bind:model="model"
              v-bind:codes="codes" />
liuxiaojing committed
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
          </el-tab-pane>

          <!-- 会计分录 -->
          <el-tab-pane label="会计分录" name="gle">
            <m-glelst v-bind:model="model" />
          </el-tab-pane>

          <!-- 申报信息 -->
          <el-tab-pane label="申报信息" name="report">
            <m-report
              v-bind:model="model"
              v-bind:codes="codes"/>
          </el-tab-pane>

          <!-- 境外汇款申请书 -->
          <el-tab-pane v-if="model.bopmod.szflg === '1'" label="境外汇款申请书" name="dbb">
            <m-dbb
              v-bind:model="model"
              v-bind:codes="codes"/>
          </el-tab-pane>

          <!-- 境内汇款申请书 -->
          <el-tab-pane v-if="model.bopmod.szflg === '2'" label="境内汇款申请书" name="dbe">
            <m-dbe
              v-bind:model="model"
              v-bind:codes="codes"/>
          </el-tab-pane>

          <!-- 报送 -->
          <el-tab-pane v-if="model.rmbmod.rmbflg === '1'" label="报送信息" name="baosong">
            <m-baosong
              v-bind:model="model"
              v-bind:codes="codes"/>
          </el-tab-pane>

          <!-- 结汇申报 -->
          <el-tab-pane v-if="model.jspmod.jshtyp === '1'" label="结汇申报" name="dbj">
            <m-dbj
              v-bind:model="model"
              v-bind:codes="codes"/>
          </el-tab-pane>

          <!-- 购汇申报 -->
          <el-tab-pane v-if="model.jspmod.jshtyp === '2'" label="购汇申报" name="dbw">
            <m-dbw
              v-bind:model="model"
              v-bind:codes="codes"/>
          </el-tab-pane>

          <!-- 面函 -->
          <el-tab-pane label="面函" name="doc">
            <m-doc v-bind:model="model"/>
          </el-tab-pane>
        </el-tabs>
      </el-form>
      <el-col class="eContainer-func">
liuxin committed
104
        <c-button
liuxiaojing committed
105 106 107 108
          v-if="activeName === 'basic' || activeName === 'fee' || activeName === 'gle' || activeName === 'doc'"
          type="primary"
          size="small"
          @click="submitForm('modelForm')"
liuxin committed
109 110 111 112
        >提交</c-button>
        <c-button v-if="activeName !== 'baosong'" type="primary" size="small" @click="onChk">检核</c-button>
        <c-button v-if="activeName !== 'baosong'" type="primary" size="small" @click="onPed">暂存</c-button>
        <c-button v-if="activeName !== 'baosong'" type="primary" size="small" @click="onRtn">退出</c-button>
liuxiaojing committed
113 114 115 116 117 118 119 120
      </el-col>
    </div>
  </c-page>
</template>

<script>
import Basic from "./Basic"
import Report from "./Report"
121 122 123
import Glelst from "../../Public/Glelst"
import Doc from "../../Public/Doc"
import Fee from "../../Public/Fee"
liuxiaojing committed
124 125 126 127 128 129 130 131 132 133
import BaoSong from "./BaoSong"
import Dbb from "./Dbb"
import Dbe from "./Dbe"
import Dbj from "./Dbj"
import Dbw from "./Dbw"
import Mt103 from "./Mt103"
import Mt202 from "./Mt202"
import Fmt100 from "./Fmt100"
import Cmt100 from "./Cmt100"

liuxin committed
134
import Cptopn,{descriptor,codes} from "~/model/Cptopn"
liuxiaojing committed
135

liuyunfeng committed
136 137 138
import Api from "~/service/Api"
import Utils from "~/utils"

liuxiaojing committed
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
const SWFTYP_MAP = {
  '103': 'Mt103',
  '103202': '103202',
  'F01': 'Mt103',
  'F00': 'Fmt100',
  'CM0': 'Cmt100',
  'C00': 'Cmt100',
  'C01': 'Cmt100',
}
export default {
  components:{
    "m-basic": Basic,
    "m-report": Report,
    "m-glelst": Glelst,
    "m-doc": Doc,
    "m-fee": Fee,
    "m-dbb": Dbb,
    "m-dbe": Dbe,
    "m-dbj": Dbj,
    "m-dbw": Dbw,
    "m-baosong": BaoSong,
    "m-mt103": Mt103,
    "m-mt202": Mt202,
    'm-fmt100': Fmt100,
    'm-cmt100': Cmt100
liuxin committed
164 165 166
  },
  computed: {

liuxiaojing committed
167 168 169 170
  },
  data: function () {
    return {
      activeName: 'basic',
fukai committed
171
      model:new Cptopn().data,
liuxiaojing committed
172
      codes,
fukai committed
173
      rules:descriptor 
liuxiaojing committed
174 175 176 177
    }
  },
  computed: {
    baowenType: function () {
fukai committed
178 179
      if (this.model.cpdgrp.rec.swftyp) {
        let swftyp = this.model.cpdgrp.rec.swftyp
liuxiaojing committed
180 181 182 183 184 185 186
        return SWFTYP_MAP[swftyp]
      } else {
        return ''
      }
    }
  },
  methods: {
liuyunfeng committed
187
    async onTabClick () {
liuxiaojing committed
188
      console.log('tab change')
liuyunfeng committed
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
      // console.log(model)
      this.formBlur = true  //已触发表单提交处理
      const rtnmsg = await Api.post('cptopn/setmod_ast', { data: Utils.flatObject(this.model) })
      if (rtnmsg.code == SUCCESS) {
        // Utils.copyValueFromVO(this.model,rtnmsg.data)
        //费用明细
        this.model.setmod.setfeg.fegmod.feslst = rtnmsg.data.setmod_setfeg_fegmod_feslst
        //账务明细
        this.model.setmod.setglg.glgmod.glslst = rtnmsg.data.setmod_setglg_glgmod_glslst
        //会计分录
        this.model.setmod.glemod.glelst = rtnmsg.data.setmod_glemod_glelst
      }
      else {
        this.$notify.error({title: '错误',message: '服务请求失败!'})
      }
      //面函
      const rtnmsgdoc = await Api.post('cptopn/trndoc_reldoc', { data: Utils.flatObject(this.model) })
      if (rtnmsgdoc.code == SUCCESS) {
        // alert("doc:"+rtnmsgdoc.data.trnmod_trndoc_docmod_doclst[0].id)
        // Utils.copyValueFromVO(this.model.trnmod.trndoc.docmod.doclst,rtnmsgdoc.data.trnmod_trndoc_docmod_doclst)
        this.model.trnmod.trndoc.docmod.doclst=rtnmsgdoc.data.trnmod_trndoc_docmod_doclst
      }
      else {
        this.$notify.error({title: '错误',message: '服务请求失败!'})
      }

liuxiaojing committed
215 216
    },
    submitForm (formName) {
liuxin committed
217
      console.log(this.model.cpdgrp.rec.orcacc)
liuxiaojing committed
218 219
      this.$refs[formName].validate((valid) => {
        if (valid) {
liuyunfeng committed
220 221
          // alert('submit!');
          this.onSav();
liuxiaojing committed
222 223 224 225 226
        } else {
          console.log('error submit!!');
          return false;
        }
      });
liuyunfeng committed
227 228 229 230 231 232
    },
    async onSav () {
      console.log('提交')
      const rtnmsgdoc = await Api.post('cptopn/sav', { data: Utils.flatObject(this.model) })
      if (rtnmsgdoc.code == SUCCESS) {
        // this.model.trnmod.trndoc.docmod.doclst=rtnmsgdoc.data.trnmod_trndoc_docmod_doclst
liuyunfeng committed
233 234
        this.$notify.info('提交成功!')
        this.$router.push('office')
liuyunfeng committed
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
      }
      else {
        this.$notify.error({title: '错误',message: '服务请求失败!'})
      }
    },
    async onChk () {
      console.log('检核')
      const rtnmsgdoc = await Api.post('cptopn/chk', { data: Utils.flatObject(this.model) })
      if (rtnmsgdoc.code == SUCCESS) {
        // this.model.trnmod.trndoc.docmod.doclst=rtnmsgdoc.data.trnmod_trndoc_docmod_doclst
      }
      else {
        this.$notify.error({title: '错误',message: '服务请求失败!'})
      }
    },
    async onPed () {
      console.log('暂存')
      const rtnmsgdoc = await Api.post('cptopn/ped', { data: Utils.flatObject(this.model) })
      if (rtnmsgdoc.code == SUCCESS) {
        // this.model.trnmod.trndoc.docmod.doclst=rtnmsgdoc.data.trnmod_trndoc_docmod_doclst
      }
      else {
        this.$notify.error({title: '错误',message: '服务请求失败!'})
      }
    },
    async onRtn () {
      console.log('退出')
      const rtnmsgdoc = await Api.post('cptopn/rtn', {  })
      if (rtnmsgdoc.code == SUCCESS) {
        // this.model.trnmod.trndoc.docmod.doclst=rtnmsgdoc.data.trnmod_trndoc_docmod_doclst
      }
      else {
        this.$notify.error({title: '错误',message: '服务请求失败!'})
      }
liuxin committed
269 270 271 272
    },
    tabClick(){

    },
liuxiaojing committed
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
  }
}
</script>

<style>
.eContainer {
  margin: 10px;
}
.eContainer-func {
  text-align: center;
  margin-top: 20px;
}
.m-inputbtn {
	position: relative
}
.m-inputbtn-input {
	padding-right: 64px;
	display: inline-block;
}
.m-inputbtn-btn {
	position: absolute;
	right: 0;
}
.m-cur-select {
  padding-right: 20px;
}
</style>