Commit f3de2cda by chengzhuoshen

前端暂存代码

parent 096a98e9
......@@ -6,7 +6,6 @@ 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 Api from "~/service/Api"
import GitopnRequest from "../model/GitopnRequest"
export default {
......@@ -169,143 +168,142 @@ export default {
// 支出目的修改--联动保函开立类型
handleChangePurpos() {
this.queryHndtypCodeTableList(this.root.trnName);
methods: {
//组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)
}
},
//组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) {
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: "暂存成功",
message: "校验成功",
type: "success",
});
return
}
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)
}
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)
}
},
};
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