Commit 90bf4159 by wangguangchao
parents 9185351a ece29642
......@@ -54,32 +54,68 @@ export default {
},
computed: {
tableColumns() {
const arr = [];
for (let i = 0; i < this.columns.length; i++) {
const column = this.columns[i];
const label = column.split("\"")[1]
const newStr = column.replace(`\"${label}\"`, "label")
const vals = newStr.split(" ")
// "P VERTLINES TRUE"
if (vals.length <= 3) continue;
arr.push({
prop: vals[0],
label: label,
// width: vals[3],
width: "auto",
});
const columnArr = []
const lines = this.columns;
const etyReg = /\"(\w*\s?\w*)\"/
const obj = {}
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
if (etyReg.test(line)) {
const gs = line.match(etyReg)
const columnName = gs[1]
const newLine = line.replace(gs[0], "_")
const colPropArr = newLine.split(" ")
const positionArr = colPropArr[1].split(":")
if (!obj[positionArr[0]]) {
obj[positionArr[0]] = []
}
obj[positionArr[0]].push({
idx: colPropArr[0],
prop: columnName,
width: colPropArr[3]
})
}
}
return arr;
for (const k in obj) {
if (Object.hasOwnProperty.call(obj, k)) {
const o = obj[k];
const tableColumn = o.map(item => item.prop).join("\n")
columnArr.push({
prop: tableColumn,
label: tableColumn,
// width: o[0].width,
width: "auto",
index: k,
children: o
})
}
}
return columnArr.sort((a,b) => {
return parseInt(a.index) - parseInt(b.index)
})
},
tableData() {
return this.list.map((row) => {
const res = {}
const vals = row.split("\t");
for (let i = 0; i < vals.length; i++) {
res[`${i}`] = vals[i];
}
return res;
});
// return this.list.map((row) => {
// const res = {}
// const vals = row.split("\t");
// for (let i = 0; i < vals.length; i++) {
// res[`${i}`] = vals[i];
// }
// return res;
// });
const arr = []
for (let i = 0; i < this.list.length; i++) {
const d = this.list[i];
const items = d.split("\t")
const it = {}
for (let j = 0; j < this.tableColumns.length; j++) {
const column = this.tableColumns[j];
it[column['prop']] = column.children.map(c => items[c['idx']] || " ").join("\n")
}
it['IDX'] = i
arr.push(it)
}
return arr
},
},
data() {
......@@ -120,6 +156,9 @@ export default {
</script>
<style>
.eContainer-table-block{
margin-top: 15px;
}
.eContainer-table-block .paginationLable{
font-size: 12px;
color: #808080;
......@@ -137,4 +176,8 @@ export default {
.el-table .success-row {
background: #f0f9eb;
}
.eContainer-table-block .el-table .cell{
white-space: pre-wrap;
}
</style>
\ No newline at end of file
......@@ -231,17 +231,16 @@ function defaultDidgrpCbsNom1Cur(rule, value, callback)
function defaultDidgrpCbsNom1Amt(rule, value, callback) {
const that = this;
// 信用证最大金额
caculateMaxAmt(that)
// 大写金额
that.executeDefault("ditp.amt").then(res => {
that.model.ditp.amt = res.data.ditp_amt;
})
// 摘要
that.executeDefault("didgrp.rec.nam").then(res => {
that.model.didgrp.rec.nam = res.data.didgrp_rec_nam;
})
callback()
caculateMaxAmt(that, callback)
// // 大写金额
// that.executeDefault("ditp.amt").then(res => {
// that.model.ditp.amt = res.data.ditp_amt;
// })
// // 摘要
// that.executeDefault("didgrp.rec.nam").then(res => {
// that.model.didgrp.rec.nam = res.data.didgrp_rec_nam;
// })
// callback()
}
function defaultSetmodZmqacc() {
}
......@@ -439,6 +438,11 @@ function defaultDidgrpRecNomton(rule, value, callback) {
function caculateMaxAmt (that, callback) {
that.executeDefault("didgrp.cbs.max.amt").then(res => {
// 大写金额
that.model.ditp.amt = res.data.ditp_amt;
// 摘要
that.model.didgrp.rec.nam = res.data.didgrp_rec_nam;
// 信用证最大金额
that.model.didgrp.cbs.max.amt = res.data.didgrp_cbs_max_amt;
if (callback) {
callback()
......
......@@ -5,29 +5,10 @@ export default {
let rtnmsg = await Api.post("ditopn/executeRule/ditp.butgetref", Utils.getRequestDataFn.call(this))
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
const ownref = rtnmsg.data.didgrp_rec_ownref
const h = this.$createElement;
this.$msgbox({
title: '获取结果',
message: h('p', null, [
h('div', { style: 'margin-left: 25%'}, `参考号:${ownref}`),
h('div', { style: 'margin-left: 25%' }, '是否将结果填入表单?')
]),
showCancelButton: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(action => {
this.model.didgrp.rec.ownref = ownref
this.$message({
type: 'success',
message: '填入成功!'
});
}).catch(action => {
this.$message({
type: 'info',
message: "已取消"
})
this.model.didgrp.rec.ownref=rtnmsg.data.didgrp_rec_ownref
this.$message({
type: 'success',
message: '获取成功!'
});
}
else {
......
......@@ -379,7 +379,9 @@ export default {
},
display(index, row){
let viewurl ="/#/display/"+row['10'].toLowerCase()+"?trn="+row['1']
const d = this.stmData.data[index]
const ds = d.split("\t")
let viewurl ="/#/display/"+ds['10'].toLowerCase()+"?trn="+ds['1']
window.open(viewurl, 'newwindow', 'height=1200,width=900,top=100,left=100,toolbar=no,resizable=no,menubar=no,location=no, status=no');
}
}
\ No newline at end of file
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