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