Commit 7f8ed9eb 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 573c634b 4fa427f3
......@@ -14,6 +14,7 @@
"bignumber.js": "^9.0.1",
"cluster": "^0.7.7",
"core-js": "^3.6.4",
"docx-preview": "^0.1.15",
"echarts": "^5.2.2",
"element-ui": "^2.13.2",
"es6-promise": "^4.2.8",
......
......@@ -21,38 +21,47 @@ export default {
},
// 检核
async handleCheck() {
// this.$refs['modelForm'].validate((valid) => {
// console.log('valid', valid)
// })
const loading = this.loading('正在校验数据');
const rtnmsg = await Api.post(this.requestPrefix + '/checkAll', {
const rtnmsg = await Api.post('/service/gitopn/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;
}
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]))
},
trigger: ['change', 'blur']
}
]
}
})
console.log('rules', this.rules)
this.$refs['modelForm'].validate((valid) => {
console.log('valid', valid)
})
}
// this.$notify({
// title: '成功',
// message: '校验成功',
// type: 'success',
// });
loading.close();
},
// 暂存
handleStash() {
console.log('暂存');
async handleStash() {
const res = await Api.post('/service/gitopn/txnHold', {
...this.model,
transName: this.trnName,
userId: window.sessionStorage.userId || 'ZL',
});
console.log('暂存', res);
},
async tabClick(tab) {
if (this.isInDisplay) {
......@@ -70,8 +79,10 @@ export default {
break;
case 'setpan':
let setfegRequest = buildFn.buildSetfeg(this.model, this.trnName);
let setglgRequest = buildFn.buildSetglg(this.model, this.trnName);
this.processSetpan(setfegRequest, setglgRequest);
// 此处利用回调是为了等setfeg的接口调用完成后才去获取setglg参数,由于setglg参数依赖于setfeg函数的返回值
this.processSetpan(setfegRequest, () => {
return buildFn.buildSetglg(this.model, this.trnName)
});
break;
case 'docpan':
let docpanRequest = buildFn.builDocpan(this.model, this.trnName);
......@@ -84,7 +95,6 @@ export default {
default:
return;
}
},
// 点击获取按钮拉取当前key字段下的表单数据
queryFormData(key) {
......
......@@ -138,6 +138,7 @@ import Docpan from "~/components/business/docpan/views";
import Doctre from "~/views/Public/Doctre";
import Limitbody from "~/views/Public/Limitbody";
import moment from "moment";
import { mapState } from 'vuex';
export default {
name: "Gitopn",
......@@ -172,6 +173,11 @@ export default {
"m-limitbody": Limitbody,
"m-aacp": Aacp,
},
computed: {
...mapState({
toHandleRowData: (state) => state.toHandleRowData
})
},
provide() {
return {
root: this,
......@@ -279,7 +285,7 @@ export default {
this.model.gitp.labissref = 'Issuing Bank\'s Ref.'
this.model.gitp.laborcdat = 'Contract Date'
this.model.gitp.letterlabel = '面函标题'
this.model.gitp.usr.extkey = 'ZL'
this.model.gitp.usr.extkey = window.sessionStorage.userId || 'ZL'
this.model.liaall.exttotamt = '0.000'
this.model.liaall.exttotoldamt = '0.000'
this.model.liaccv.cshpct = '0.00'
......@@ -291,12 +297,23 @@ export default {
this.model.liaall.limmod.ccvamt = '0.000'
this.model.liaall.limmod.comamt = '0.000'
this.model.liaall.misamt = '0.000'
this.model.pageId = 'CtxCache-4079be82-bb5e-4ced-835e-0f20d3268ec2'
this.model.setmod.dspflg = 'CG'
},
async init () {
const params = {
...this.toHandleRowData
}
const res = await Api.post('/service/xxx/xxx', {
...params,
transName: this.trnName,
userId: window.sessionStorage.userId || 'ZL',
});
console.log(res)
}
},
created () {
this.initModelData()
// this.initModelData()
// this.init()
this.queryHndtypCodeTableList(this.trnName)
},
mounted () {},
......
......@@ -51,27 +51,12 @@ export default {
this.$router.push({ path: 'business-new/sptpopup', query: { inr: inr } });
},
async continueEdit(row, scope) {
//let rtnmsg = await Api.post("getPendingData",{params:{'selsptinr':row[0]}})
//if (rtnmsg.respCode == SUCCESS) {
//var cacheFileName = rtnmsg.data.cacheFileName;
// this.model.selsptinr = row['INR'];
// const selIds = [];
// selIds.push(row['IDX']);
// let params = { selDst: "sptstm", selIds: selIds };
// let rtnmsg = await this.executeRule("tak", params)
// if (rtnmsg.respCode == SUCCESS) {
//TODO 处理数据逻辑
this.updateToHandleRowData(row)
let trnName = row.frm.toLowerCase();
// let viewurl = "/business/ditopn?selsptinr=" + row[0];
//let viewurl = "/business/"+trnName+"?selsptinr=" + row['INR'];
this.$router.push({
name: trnName.charAt(0).toUpperCase() + trnName.substring(1),
params: { prePageId: this.model.pageId },
});
// }
// else {
// this.$notify.error({ title: '错误', message: '服务请求失败!' });
// }
},
// pageSize改变
handleSizeChange(val) {
......
......@@ -148,6 +148,7 @@
<script>
import Api from '~/service/Api';
import event from '../event'
import { mapMutations } from 'vuex';
export default {
inject: ['root'],
props: ['model', 'codes'],
......@@ -238,6 +239,7 @@ export default {
// this.$store.commit('setTaskList', {key: 'sptsel', val: this.stmData.data.length})
},
methods: {
...mapMutations(['updateToHandleRowData']),
// async choose(idx,row){
// var params = {selDst:"sptstm",selrow:[idx+1]}
// let rtnmsg = await this.executeRule("sptstm" , params) //SPTSTM
......
......@@ -4,7 +4,8 @@ import Utils from '~/utils';
export default {
async processLiaccv(liaccvRequest) {
const loading = this.loading('正在请求数据');
let rtnmsg = await Api.post('/service/liaccv/assertLiaccv', liaccvRequest);
let objtyp = liaccvRequest.rec.objtyp;
let rtnmsg = await Api.post(`/service/${ objtyp.toLowerCase() }/liaccv/assertLiaccv`, liaccvRequest);
if (rtnmsg.respCode == SUCCESS) {
Utils.copyValueFromVO(this.model.liaccv, rtnmsg.data);
}
......
......@@ -4,7 +4,8 @@ import Utils from '~/utils';
export default {
async processTrndoc(trndocRequest) {
const loading = this.loading('正在请求数据')
let rtnmsg = await Api.post('/service/docpan/assertTrndoc', trndocRequest);
let objtyp = trndocRequest.rec.objtyp;
let rtnmsg = await Api.post(`/service/${ objtyp.toLowerCase() }/docpan/assertTrndoc`, trndocRequest);
if (rtnmsg.respCode == SUCCESS) {
Utils.copyValueFromVO(this.model.docpan, rtnmsg.data);
}
......
......@@ -3,9 +3,9 @@ import Utils from '~/utils';
export default {
async processLiaall(liaallRequest) {
//组数据,发post请求
const loading = this.loading('正在请求数据')
let rtnmsg = await Api.post('/service/liaall/assertLiaall', liaallRequest);
let objtyp = liaallRequest.rec.objtyp;
let rtnmsg = await Api.post(`/service/${ objtyp.toLowerCase() }/liaall/assertLiaall`, liaallRequest);
if (rtnmsg.respCode == SUCCESS) {
Utils.copyValueFromVO(this.model.liaall, rtnmsg.data);
}
......
......@@ -2,9 +2,9 @@ import Api from '~/service/Api';
export default {
async processGlentry(glentryRequest) {
//组数据,发post请求
const loading = this.loading('正在请求数据')
let rtnmsg = await Api.post('/service/gle/assertGle', glentryRequest);
let objtyp = glentryRequest.rec.objtyp;
let rtnmsg = await Api.post(`/service/${ objtyp.toLowerCase() }/gle/assertGle`, glentryRequest);
if (rtnmsg.respCode == SUCCESS) {
this.model.setmod.glemod.gleshwstm = rtnmsg.data.gleshwstm;
}
......
<template>
<div class="eibs">
<c-col :span="24" style="">
<c-istream-table :list="data" :columns="columns"></c-istream-table>
</c-col>
<c-col :span="24" style="">
<c-istream-table :list="data" :columns="columns"></c-istream-table>
</c-col>
</div>
</template>
<script>
import Api from "~/service/Api"
import commonProcess from "~/mixin/commonProcess";
import CodeTable from "~/config/CodeTable"
import Api from '~/service/Api';
import commonProcess from '~/mixin/commonProcess';
import CodeTable from '~/config/CodeTable';
export default {
inject: ['root'],
mixins: [commonProcess],
props:["model","codes"],
data(){
return {
columns: [
"2 1 \"借/贷\" 80 1 0",
"6 2 \"账号\" 200",
"3 3 \"币种\" 70",
"4 4 \"金额\" 150 2 8:1 2 5",
"5 5 \"起息日\" 150",
"7 6 \"牌价类型\" 100",
"8 7 \"牌价\" 100 2 0 1 0",
"9 8 \"会计科目\" 100",
"0 9 \"分录序号\" 100 1 0"
],
data: [
]
inject: ['root'],
mixins: [commonProcess],
props: ['model', 'codes'],
data() {
return {
columns: [
'2 1 "借/贷" 80 1 0',
'6 2 "账号" 200',
'3 3 "币种" 70',
'4 4 "金额" 150 2 8:1 2 5',
'5 5 "起息日" 150',
'7 6 "牌价类型" 100',
'8 7 "牌价" 100 2 0 1 0',
'9 8 "会计科目" 100',
'0 9 "分录序号" 100 1 0',
],
data: [],
};
},
watch: {
//this.$refs.glepan.stmData.data = res.data.setmod_glemod_gleshwstm.rows;
'model.setmod.glemod.gleshwstm': {
handler(val, oldVal) {
if (val.rows) {
this.data = val.rows;
}
},
immediate: true,
},
watch: {
//this.$refs.glepan.stmData.data = res.data.setmod_glemod_gleshwstm.rows;
'model.setmod.glemod.gleshwstm': {
handler(val, oldVal) {
if (val.rows) {
this.data = val.rows
}
},
immediate: true
}
},
methods:{
},
created:function(){
}
}
},
methods: {},
created: function () {},
};
</script>
<style>
</style>
<style></style>
import Api from '~/service/Api';
export default {
async processSetpan(setfegRequest, setglgRequest) {
async processSetpan(setfegRequest, fn) {
let loading = this.loading('正在请求试算费用');
let rtnmsg = await Api.post('/service/setmod/calcSettleDetail', setfegRequest);
if (rtnmsg.respCode == SUCCESS) {
let objtyp = setfegRequest.rec.objtyp;
let rtnmsg = await Api.post(`/service/${ objtyp.toLowerCase() }/setmod/calcSettleDetail`, setfegRequest);
if (rtnmsg.respCode === SUCCESS) {
this.model.setmod.setfeg = rtnmsg.data.setfeg;
this.model.setmod.ref = rtnmsg.data.ref;
this.model.setmod.doccur = rtnmsg.data.doccur;
this.model.setmod.docamt = rtnmsg.data.docamt;
// 试算账务
if (this.model.setmod.setfeg.setfel.length > 0) {
if (this.model.setmod.setfeg.setfel.length === 0) {
loading = this.loading('正在请求试算账务');
let res = await Api.post('/service/setmod/calcPayDetail', setglgRequest);
let setglgRequestParams = fn()
let res = await Api.post(`/service/${ objtyp.toLowerCase() }/setmod/calcPayDetail`, setglgRequestParams);
if (res.respCode == SUCCESS) {
this.model.setmod.setglg = res.data.setglg;
}
......
......@@ -6,6 +6,7 @@ import TagsView from "./TagsView"
import Transaction from "./Transaction";
import Vuex from 'vuex'
import Vue from 'vue'
import gitopn from './modules/gitopn.js'
Vue.use(Vuex)
......@@ -16,7 +17,8 @@ const store = new Vuex.Store({
Status: Status,
Swift: Swift,
TagsView: TagsView,
Transaction: Transaction
Transaction: Transaction,
gitopn
}
})
......
const store = {
state: {
toHandleRowData: {},
},
mutations: {
updateToHandleRowData(state, params) {
state.toBehandleRowData = params
}
}
}
export default store
<template>
<div>
<div style="height: 800px; overflow: auto">
<embed
v-if="this.model.docXML && pdf"
:src="pdf"
type="application/pdf"
height="100%"
width="100%"
/>
<c-row v-if="!this.model.docXML">
<c-col v-for="(item, index) in model.docTXT" :key="index" >
<c-col :offset="4" :span="8">
{{ item[0] }}
</c-col>
<c-col :span="12">
{{ item[1] }}
</c-col>
</c-col>
</c-row>
</div>
</div>
<div class="width: 100%;height: 100vh;overflow: auto;" ref="file"></div>
</template>
<script>
import { getPdf } from "~/service/business/file";
import { renderAsync } from 'docx-preview';
import Api from '~/service/Api';
import commonProcess from '~/mixin/commonProcess';
export default {
data() {
return {
model: { docXML: "" },
pdf: "",
};
},
created() {
let doclang= window.sessionStorage.doclang||"";
this.model.docXML = window.sessionStorage.docXML;
this.model.docTXT = window.sessionStorage.docTXT
.split("\r\n")
.filter((item) => item)
.map((item) => {
let idx = item.indexOf(":");
return [
item.substring(0, idx).trim(),
item.substring(idx + 1).trim(),
];
});
if (this.model.docXML != "")
getPdf({ xml: this.model.docXML, doclang: window.sessionStorage.docuil }).then((res) => {
if (res.respCode == SUCCESS) {
this.pdf ="data:application/pdf;base64,"+ res.data;
}
});
},
data() {
return {
model: { docXML: '' },
pdf: '',
};
},
mixins: [commonProcess],
mounted() {
this.loadWordBlob()
},
methods: {
async loadWordBlob () {
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]);
renderAsync(blob, this.$refs.file)
}
}
}
};
</script>
<style scoped>
</style>
\ No newline at end of file
::v-deep .docx-wrapper {
width: 100%;
height: 100vh;
padding: 0;
overflow: auto;
}
</style>
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