Commit 6b86682f by WF1020

Merge branch 'settle-test-20230110' of http://114.115.138.98:8900/fukai/vue-gjjs…

Merge branch 'settle-test-20230110' of http://114.115.138.98:8900/fukai/vue-gjjs into settle-test-20230110
parents 1a0017a7 d848c764
......@@ -110,5 +110,13 @@ export default {
concur: model.liaccv.concur,
};
return params
},
// 公共组件setmod中dsp字段改变,触发联动时候的入参
buildSetgllAccts (model, trnName, setglg) {
let params = {
...this.buildCommonData(model, trnName),
setglg
};
return params
}
}
\ No newline at end of file
import Api from '~/service/Api';
import commonFunctions from '~/mixin/commonFunctions.js'
import buildFn from './buildCommons.js'
import setmod from '~/components/business/setmod/event'
import glentry from '~/components/business/glentry/event'
import engp from '~/components/business/engp/event'
import docpan from '~/components/business/docpan/event'
import ccvpan from '~/components/business/ccvpan/event'
import GitopnRequest from "../model/GitopnRequest"
import commonFunctions from '~/mixin/commonFunctions.js';
import buildFn from './buildCommons.js';
import setmod from '~/components/business/setmod/event';
import glentry from '~/components/business/glentry/event';
import engp from '~/components/business/engp/event';
import docpan from '~/components/business/docpan/event';
import ccvpan from '~/components/business/ccvpan/event';
export default {
mixins: [commonFunctions],
......@@ -29,24 +28,24 @@ export default {
userId: window.sessionStorage.userId || 'ZL',
});
if (rtnmsg.respCode === SUCCESS) {
let errorRules = rtnmsg.data
let errorRules = rtnmsg.data;
Object.keys(errorRules).map((ruleKey) => {
// 此处判断是为了区分,如果在前端做了校验后端也校验了就不采用自定义校验规则
if (!this.rules[ruleKey]) {
this.rules[ruleKey] = [
{
validator: (rule, value, callback) => {
callback(new Error(errorRules[ruleKey]))
callback(new Error(errorRules[ruleKey]));
},
trigger: ['change', 'blur']
}
]
trigger: ['change', 'blur'],
},
];
}
})
console.log('rules', this.rules)
});
console.log('rules', this.rules);
this.$refs['modelForm'].validate((valid) => {
console.log('valid', valid)
})
console.log('valid', valid);
});
}
// this.$notify({
// title: '成功',
......@@ -57,16 +56,33 @@ export default {
},
// 暂存
async handleStash() {
const res = await Api.post('/service/gitopn/txnHold', {
...this.model,
transName: this.trnName,
const loading = this.loading('正在暂存数据');
let params = {
transName: this.trnName.toUpperCase(),
userId: window.sessionStorage.userId || 'ZL',
});
console.log('暂存', res);
liaccvg: this.model.liaccv.liaccvg,
liaallg: this.model.liaall.liaallg,
setfog: this.model.setmod.setfog,
setfeg: this.model.setmod.setfeg,
setglg: this.model.setmod.setglg,
doceot: this.model.docpan.doceot,
gidgrp: this.model.gidgrp,
gitp: this.model.gitp,
}
const res = await Api.post('/service/gitopn/txnHold', params);
if (res.respCode === SUCCESS) {
this.$notify({
title: '成功',
message: '暂存成功',
type: 'success',
});
loading.close();
this.$router.push('/taskList')
}
},
async tabClick(tab) {
if (this.isInDisplay) {
return
return;
}
let name = tab.name;
switch (name) {
......@@ -82,7 +98,7 @@ export default {
let setfegRequest = buildFn.buildSetfeg(this.model, this.trnName);
// 此处利用回调是为了等setfeg的接口调用完成后才去获取setglg参数,由于setglg参数依赖于setfeg函数的返回值
this.processSetpan(setfegRequest, () => {
return buildFn.buildSetglg(this.model, this.trnName)
return buildFn.buildSetglg(this.model, this.trnName);
});
break;
case 'docpan':
......@@ -169,141 +185,23 @@ export default {
handleChangePurpos() {
this.queryHndtypCodeTableList(this.root.trnName);
},
//组GitopnRequest
buildGitopnRequest() {
let gitopnRequest = new GitopnRequest().data;
gitopnRequest.transName = "GITOPN";
gitopnRequest.userId = window.sessionStorage.userId || 'ZL';
gitopnRequest.liaccvg = this.model.liaccv.liaccvg;
gitopnRequest.liaallg = this.model.liaall.liaallg;
gitopnRequest.setfog = this.model.setmod.setfog;
gitopnRequest.setfeg = this.model.setmod.setfeg;
gitopnRequest.setglg = this.model.setmod.setglg;
gitopnRequest.doceot = this.model.docpan.doceot;
gitopnRequest.gidgrp = this.model.gidgrp;
gitopnRequest.gitp = this.model.gitp;
return gitopnRequest;
},
// 提交
handleSubmit() {
console.log('提交', this.model)
},
// 检核
async handleCheck() {
// this.$refs['modelForm'].validate((valid) => {
// console.log('valid', valid)
// })
const loading = this.loading("正在校验数据")
const rtnmsg = await Api.post(this.requestPrefix + "/checkAll", {
...this.model,
transName: this.trnName,
userId: window.sessionStorage.userId || 'ZL'
})
if (rtnmsg.respCode === SUCCESS) {
this.updateValueSet(rtnmsg.codeSet)
}
if (rtnmsg.respCode === SUCCESS) {
const fieldErrors = rtnmsg.fieldErrors;
this.updateModel(rtnmsg.data);
if (fieldErrors && Object.keys(fieldErrors).length === 0) {
// 清除之前的校验状态
this.getRoot().$refs.modelForm.clearValidate();
this.$notify({
title: "成功",
message: "校验成功",
type: "success",
});
return
}
}
loading.close()
},
// 暂存
async handleStash() {
const loading = this.loading("正在暂存数据");
let gitopnRequest = this.buildGitopnRequest();
const rtnmsg = await Api.post(this.requestPrefix + "/txnHold", gitopnRequest);
if (rtnmsg.respCode === SUCCESS) {
this.$notify({
title: "成功",
message: "暂存成功",
type: "success",
});
}
loading.close();
},
// 点击获取按钮拉取当前key字段下的表单数据
queryFormData(key) {
console.log(key)
},
// 业务信息=》基本信息=》保函编号-----获取保函编号
async queryOwnref() {
let params = {
ptainr: this.model.gidgrp.apl.pts.ptainr,
businessType: 'LG',
tbl: 'LG'
}
const loading = this.loading()
let res = await Api.post('/service/gitopn/getOwnRef', params)
if (res.respCode == SUCCESS) {
loading.close()
this.model.gidgrp.rec.ownref = res.data
}
},
// 获取gitopn弹框表格数据
async queryGridEtyPromptDialogData(type, ptytyp) {
let params = {
userId: window.sessionStorage.userId || 'ZL',
ptytyp: ptytyp,
extkey: this.model.gidgrp[type.toLowerCase()].pts.extkey
}
let res = await Api.post('/service/ptspta/list', params)
if (res.respCode == SUCCESS) {
this.root.$refs['etyDialog'].show = true
this.root.promptData.data = res.data.ptaInfos
this.root.promptData.type = type
}
},
// 选中gitopn弹框表格的行数据
async selectGridEtyPromptData(row) {
let params = {
...row
}
let res = await Api.post('/service/ptspta/fetch', params)
if (res.respCode == SUCCESS) {
this.$set(this.model.gidgrp, row.role.toLowerCase(), res.data)
}
},
// 业务信息=》基本信息=》支出目的
purposChange(key, value) {
this.handleChangeForm(key, value)
},
// 初始化保函开立类型码表下拉列表
async queryHndtypCodeTableList(trnName) {
let params = {
gitp: {
swiftflg: this.model.gitp.swiftflg
},
gidgrp: {
rec: {
purpos: this.model.gidgrp.rec.purpos
}
},
transName: trnName.toUpperCase()
}
let res = await Api.post('/service/gitopn/initHndtyp', params)
if (res.respCode == SUCCESS) {
this.$set(this.codes, 'voHndtyp', res.data)
}
},
// 是否SWIFT格式修改--联动保函开立类型
handleChangeSwiftflg() {
this.queryHndtypCodeTableList(this.root.trnName)
},
// 支出目的修改--联动保函开立类型
handleChangePurpos() {
this.queryHndtypCodeTableList(this.root.trnName)
// 公共组件setmod处理方式改变触发联动
changeSetmodModel (emitParams) {
let reqParams = {}
switch (emitParams.code) {
case 'processMethods':
reqParams = buildFn.buildSetglg(this.model, this.trnName);
this.calcPayDetail(reqParams)
break
case 'changeDsp':
let setglgRequest = buildFn.buildSetglg(this.model, this.trnName);
setglgRequest.setglg = {setgll: emitParams.list};
this.setgllAccts(setglgRequest, emitParams.index)
emitParams.list = this.model.setmod.setglg.setgll;
break
default:
return
}
}
},
};
......@@ -168,27 +168,27 @@ export default class Gitopn {
cbs: {
cnf: {
cur: '', // Confirmation Amount .gidgrp.cbs.cnf.cur
amt: '', // Balance .gidgrp.cbs.cnf.amt
amt: '0.00', // Balance .gidgrp.cbs.cnf.amt
},
mac2: {
cur: '',
amt: '',
amt: '0.00',
},
mac: {
cur: '',
amt: '',
amt: '0.00',
},
max: {
cur: '', // Guarantee Amount .gidgrp.cbs.max.cur
amt: '', // Guarantee Amount .gidgrp.cbs.max.amt
amt: '0.00', // Guarantee Amount .gidgrp.cbs.max.amt
},
opc2: {
cur: '',
amt: '',
amt: '0.00',
},
opn1: {
cur: '', // Open Amount .gidgrp.cbs.opn1.cur
amt: '', // Balance .gidgrp.cbs.opn1.amt
amt: '0.00', // Balance .gidgrp.cbs.opn1.amt
},
},
blk: {
......
......@@ -50,7 +50,7 @@
v-model="model.gidgrp.rec.sndto"
style="width: 100%"
placeholder="请选择发送保函文本"
:code="getValues('gidgrp.rec.sndto')"
:code="codes.sndto"
>
</c-select>
</el-form-item>
......
......@@ -43,7 +43,11 @@
<!--PD000027 -->
<el-tab-pane label="费用/账务" name="setpan">
<c-content>
<m-setmod :model="model" :codes="codes" />
<m-setmod
:model="model"
:codes="codes"
@changeSetmodModel="changeSetmodModel"
/>
</c-content>
</el-tab-pane>
......@@ -105,6 +109,7 @@
</template>
<script>
import event from '../event'
import commonProcess from "~/mixin/commonProcess";
import formRules from '../model/check'
import CodeTable from "~/config/CodeTable";
import Gitopn from "../model";
......@@ -184,7 +189,8 @@ export default {
activeNames: ["ovwp"],
};
},
mixins: [event],
// 里面包含了Default、Check等的公共处理
mixins: [commonProcess, event],
data() {
return {
tabVal: "ovwp",
......
import Api from '~/service/Api';
export default {
export default {
async processSetpan(setfegRequest, fn) {
let loading = this.loading('正在请求试算费用');
let objtyp = setfegRequest.rec.objtyp;
......@@ -21,5 +20,22 @@ export default {
}
}
loading.close()
},
async calcPayDetail(setglgRequest) {
let loading = this.loading('正在请求试算账务');
let rtnmsg = await Api.post('/service/gid/setmod/calcPayDetail', setglgRequest);
if (rtnmsg.respCode == SUCCESS) {
this.model.setmod.setglg = rtnmsg.data.setglg;
}
loading.close()
},
async setgllAccts(reqParams, index) {
let loading = this.loading();
let rulePath = '/service/gid/setmod/setgll/' + index + '/accts';
let rtnmsg = await Api.post(rulePath, reqParams);
if (rtnmsg.respCode == SUCCESS) {
this.model.setmod.setglg = rtnmsg.data.setglg;
}
loading.close()
}
}
......@@ -372,7 +372,9 @@ export default {
},
computed: {
formData() {
return this.model.setmod.setfeg.setfel[this.idx]
let formDataTmp = this.model.setmod.setfeg.setfel[this.idx];
formDataTmp.fecp1.taxrat = formDataTmp.fecp1.taxrat || '';
return formDataTmp
}
},
methods: {
......
......@@ -56,16 +56,7 @@
>
</el-option>
</c-select>
<template slot="footer">
<c-button
style=""
size="small"
type="primary"
icon="el-icon-info"
@click="onSetmodDet"
>
</c-button>
</template>
<template slot="footer"></template>
</c-fullbox>
</el-form-item>
</c-col>
......@@ -366,7 +357,7 @@
<template #default="scope">
<c-select
v-model="scope.row.dsp"
@change="dispDefault(scope.$index + 1)"
@change="changeProcessMethods('processMethods')"
>
<el-option
v-for="item in codes.setfeldsp"
......@@ -516,7 +507,7 @@
<template #default="scope">
<c-select
v-model="scope.row.dsp"
@change="dspChange(scope.$index)"
@change="changeDsp(scope.$index, 'changeDsp')"
v-if="scope.row.debcdtflg == 'D'"
>
<el-option
......@@ -533,7 +524,7 @@
</c-select>
<c-select
v-model="scope.row.dsp"
@change="dspChange(scope.$index)"
@change="changeDsp(scope.$index, 'changeDsp')"
v-if="scope.row.debcdtflg == 'C'"
>
<el-option
......@@ -558,7 +549,7 @@
>
<c-select v-model="scope.row.act">
<el-option
v-for="item in scope.act"
v-for="item in scope.row.acts"
:key="item.value"
:label="item.label"
:value="item.value"
......@@ -569,11 +560,12 @@
</template>
</el-table-column>
<el-table-column label="借/贷" prop="debcdtflg" width="70px">
</el-table-column>
<el-table-column label="原始币种" prop="cur" width="70px">
</el-table-column>
<el-table-column label="原始金额" prop="fmtamt" width="110px">
<!-- <template slot-scope="scope">
<!-- <template slot-scope="scope">
<c-input-currency
v-model="scope.row.fmtamt"
placeholder="0.00"
......@@ -1432,7 +1424,7 @@ export default {
addRowSetfol() {
let newRow = { ...this.newdialog };
this.model.setmod.setfog.setfol.splice(0, 0, newRow);
this.defaultFunction();
// this.defaultFunction();
},
removeRowSetfol() {
this.model.setmod.setfog.setfol.shift();
......@@ -1453,27 +1445,37 @@ export default {
this.defaultFunction();
},
detail1(index, row) {
this.executeDefault('setfel.det').then((res) => {
this.index = index;
this.dialogVisible = true;
this.dialog = row;
/*this.executeDefault('setfel.det').then((res) => {
this.index = index;
this.dialogVisible = true;
this.dialog = row;
});
});*/
},
dispDefault(index) {
this.executeDefault(`setmod.setfeg.setfel(${index}).mac`).then((res) => {
Utils.copyValueFromVO(this.model, res.data);
});
// 处理方式改变
changeProcessMethods(code) {
this.$emit('changeSetmodModel', {
code
})
// let vm = this;
// vm.root.calcPayDetail();
},
// 第二个表格
detail2(index, row) {
const that = this;
const rule = 'setmod.setfeg.setfel(' + (index + 1) + ').det';
that.index = index;
that.$refs.setpanDialog.visiable = true;
that.dialog2 = row;
/* const rule = 'setmod.setfeg.setfel(' + (index + 1) + ').det';
that.executeRule(rule).then((res) => {
that.index = index;
that.$refs.setpanDialog.visiable = true;
// that.$refs.setpanDialog.formData = that.model.setmod.setfeg.setfel[index];
that.dialog2 = row;
});
});*/
},
// 第三个表格
......@@ -1483,23 +1485,38 @@ export default {
},
async handleDetail(index, row) {
const that = this;
const rule = 'setmod.setglg.setgll(' + (index + 1) + ').det';
let rtnmsg = await this.executeRule(rule);
if (rtnmsg.respCode == SUCCESS) {
that.index = index;
that.$refs.detpDialog.visiable = true;
this.detpDialogVisible = true;
that.dialog3 = that.model.setmod.setglg.setgll[index];
that.rattyp = that.strCalCode(that.dialog3.rattyp, that.codes.ratetype);
that.dcbrattyp = that.strCalCode(
that.index = index;
that.$refs.detpDialog.visiable = true;
this.detpDialogVisible = true;
that.dialog3 = that.model.setmod.setglg.setgll[index];
debugger
that.rattyp = that.strCalCode(that.dialog3.rattyp, that.codes.ratetype);
that.dcbrattyp = that.strCalCode(
that.dialog3.dcbrattyp,
that.codes.ratetype
);
that.scbrattyp = that.strCalCode(
);
that.scbrattyp = that.strCalCode(
that.dialog3.scbrattyp,
that.codes.ratetype
);
}
);
// const rule = "setmod.setglg.setgll(" + (index + 1) + ").det";
// let rtnmsg = await this.executeRule(rule);
// if (rtnmsg.respCode == SUCCESS) {
// that.index = index;
// that.$refs.detpDialog.visiable = true;
// this.detpDialogVisible = true;
// that.dialog3 = that.model.setmod.setglg.setgll[index];
// that.rattyp = that.strCalCode(that.dialog3.rattyp, that.codes.ratetype);
// that.dcbrattyp = that.strCalCode(
// that.dialog3.dcbrattyp,
// that.codes.ratetype
// );
// that.scbrattyp = that.strCalCode(
// that.dialog3.scbrattyp,
// that.codes.ratetype
// );
// }
},
strCalCode(str, code) {
var result = '';
......@@ -1559,20 +1576,27 @@ export default {
});
}
},
async dspChange(index) {
let rtnmsg = await this.executeDefault(
'setmod.setglg.setgll(' + (index + 1) + ').dsp'
);
if (rtnmsg.respCode == SUCCESS) {
//TODO 处理数据逻辑
this.updateModel(rtnmsg.data);
this.$nextTick(() => {
this.executeRule('setmod.glemod.glepan').then((res) => {
//TODO 处理数据逻辑
if (res.respCode == SUCCESS) this.updateModel(res.data);
});
});
}
async changeDsp(index, code) {
this.$emit('changeSetmodModel', {
code,
index: (index + 1),
list: this.stmData3
})
// this.root.setgllAccts((index + 1), this.stmData3);
// let rtnmsg = await this.executeDefault(
// "setmod.setglg.setgll(" + (index + 1) + ").dsp"
// );
// if (rtnmsg.respCode == SUCCESS) {
// //TODO 处理数据逻辑
// this.updateModel(rtnmsg.data);
// this.$nextTick(() => {
// this.executeRule("setmod.glemod.glepan").then((res) => {
// //TODO 处理数据逻辑
// if (res.respCode == SUCCESS) this.updateModel(res.data);
// });
// });
// }
},
},
created: function () {},
......
......@@ -7717,10 +7717,6 @@ const CodeTable = {
{ label: "ISCO Issuance of counter-undertaking", value: "ISCO" },
{ label: "ICCO Issuance of counter-counter-undert", value: "ICCO" },
],
sndto: [
{ label: "ISSU Issuance of undertaking", value: "ISSU" },
{ label: "ISCO Issuance of counter-undertaking", value: "ISCO" },
{ label: "ICCO Issuance of counter-counter-undert", value: "ICCO" },
]
sndto: []
}
export default CodeTable;
<template>
<div class="width: 100%;height: 100vh;overflow: auto;" ref="file"></div>
<div>
<el-button @click="downLoad">点击下载word文件</el-button>
<div class="docWrap">
<!-- 预览文件的地方(用于渲染) -->
<div ref="file"></div>
</div>
</div>
</template>
<script>
......@@ -15,10 +21,10 @@ export default {
},
mixins: [commonProcess],
mounted() {
this.loadWordBlob()
this.goPreview ()
},
methods: {
async loadWordBlob () {
async goPreview () {
let routeQuery = this.$route.query
const params = {
index: routeQuery.idx,
......@@ -35,6 +41,30 @@ export default {
let blob = new Blob([u8arr]);
renderAsync(blob, this.$refs.file)
}
},
async downLoad () {
let routeQuery = this.$route.query
const params = {
index: routeQuery.idx,
};
let res = await Api.post('/service/gitopn/executeDocpan', this.wrapper(params));
if (res.respCode == SUCCESS) {
let base64Str = res.data.executeDocpan;
let bstr = window.atob(base64Str); // 解码 base-64 编码的字符串,base-64 编码使用方法是 btoa()
let length = bstr.length;
let u8arr = new Uint8Array(length); // 创建初始化为0的,包含length个元素的无符号整型数组
while (length--) {
u8arr[length] = bstr.charCodeAt(length); // 返回在指定的位置的字符的 Unicode 编码
}
let blob = new Blob([u8arr]);
var a = document.createElement("a"); //创建一个<a></a>标
a.href = URL.createObjectURL(blob); // 将流文件写入a标签的href属性值
a.download = "gitopn.docx"; //设置文件名
a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中
a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
a.remove(); // 一次性的,用完就删除a标签
}
}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment