Commit cc3d018e by 李少勇

联调基本信息中的申请人和受益人等弹框接口和选中行确定

parent f2625799
......@@ -19,8 +19,7 @@ export default {
// 业务信息=》基本信息=》保函编号-----获取保函编号
async queryOwnref (key) {
let params = {
// ptainr: this.model.gidgrp.apl.pts.ptainr,
ptainr: '11593381',
ptainr: this.model.gidgrp.apl.pts.ptainr,
businessType: 'LG',
tbl: 'LG'
}
......@@ -30,15 +29,29 @@ export default {
}
},
// 业务信息=》基本信息=》申请人-----获取申请人信息
async queryGidgrpAplPtsExtkey () {
async queryGidgrpAplPtsExtkey (type, ptytyp) {
console.log('model.gidgrp.ben.pts.extkey', this.model.gidgrp.ben)
console.log('type.toLowerCase()', type.toLowerCase())
let params = {
userId: 'ZL',
ptytyp: 'C',
extkey: '2000'
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) {
console.log('queryGidgrpAplPtsExtkey', res)
this.root.$refs['etyDialog'].show = true
this.root.promptData.data = res.data.ptaInfos
this.root.promptData.type = type
}
},
// 业务信息=》基本信息=》申请人-----设置申请人信息
async selectEty (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)
}
},
// 业务信息=》基本信息=》支出目的
......
......@@ -25,7 +25,7 @@
style="margin: 0 0"
size="small"
type="primary"
@click="queryOwnref('gidgrp.rec.ownref')"
@click="queryOwnref()"
>
获取
</c-button>
......@@ -707,7 +707,7 @@
v-model="model.gidgrp.apl.pts.extkey"
maxlength="16"
placeholder="请输入"
@keyup.enter.native="queryGidgrpAplPtsExtkey"
@keyup.enter.native="queryGidgrpAplPtsExtkey('APL', 'C')"
>
</c-input>
<template slot="footer">
......@@ -783,9 +783,7 @@
v-model="model.gidgrp.adv.pts.extkey"
maxlength="16"
placeholder="请输入"
@keyup.enter.native="
showGridPromptDialog(`gidgrp.adv.pts.extkey`)
"
@keyup.enter.native="queryGidgrpAplPtsExtkey('ADV', 'B')"
>
</c-input>
<template slot="footer">
......@@ -857,9 +855,7 @@
v-model="model.gidgrp.iss.pts.extkey"
maxlength="16"
placeholder="请输入"
@keyup.enter.native="
showGridPromptDialog(`gidgrp.iss.pts.extkey`)
"
@keyup.enter.native="queryGidgrpAplPtsExtkey('ISS', 'B')"
></c-input>
<template slot="footer">
<c-button
......@@ -927,9 +923,7 @@
v-model="model.gidgrp.ben.pts.extkey"
maxlength="16"
placeholder="请输入"
@keyup.enter.native="
showGridPromptDialog(`gidgrp.ben.pts.extkey`)
"
@keyup.enter.native="queryGidgrpAplPtsExtkey('BEN', 'C')"
></c-input>
<template slot="footer">
<c-button
......
......@@ -95,7 +95,7 @@
<c-grid-ety-prompt-dialog
ref="etyDialog"
:promptData="promptData"
v-on:select-ety="selectEty"
@select-ety="selectEty"
>
</c-grid-ety-prompt-dialog>
</c-page>
......@@ -190,6 +190,48 @@ export default {
...CodeTable,
},
activeNames: ["engp"],
promptData: {
title: 'Select a Party',
columns: [
{
prop: 'ptyInr',
label: 'Party Number'
},
{
prop: 'inr',
label: 'Address Number'
},
{
prop: 'branch',
label: 'Branch Code'
},
{
prop: 'bchName',
label: 'Branch Name'
},
{
prop: 'adrName',
label: 'Address Name'
},
{
prop: 'adr1',
label: 'Address1'
},
{
prop: 'locCty',
label: 'City'
},
{
prop: 'locZip',
label: 'Zip'
},
{
prop: 'bicCode',
label: 'BIC'
}
],
data: []
}
};
},
methods: {
......
......@@ -44,7 +44,7 @@ export default {
default: () => {
return {
title: "",
columnStr: "",
columns: "",
data: [],
rulePath: "",
modelUrl: "", //非机构处理需要回填的字段路劲信息,isPty为false时必输
......@@ -68,94 +68,21 @@ export default {
},
computed: {
tableColumn() {
return this.dealExtKeyTableColumn();
return this.promptData.columns
},
tableData() {
return this.dealExtKeyTableData();
return this.promptData.data
},
},
methods: {
dealExtKeyTableColumn() {
const columnArr = [];
const lines = this.promptData.columnStr.split("\n");
const etyReg = /\"([^\"]*)\"/;
const obj = {};
for (let i = 0; i < lines.length; i++) {
let 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(/\s+/);
const positionArr = colPropArr[1].split(":");
if (!obj[positionArr[0]]) {
obj[positionArr[0]] = [];
}
obj[positionArr[0]].push({
idx: colPropArr[0],
prop: columnName,
width: colPropArr[3],
});
}
}
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);
});
},
dealExtKeyTableData() {
const arr = [];
for (let i = 0; i < this.promptData.data.length; i++) {
const d = this.promptData.data[i];
const items = d.split("\t");
const it = {};
for (let j = 0; j < this.tableColumn.length; j++) {
const column = this.tableColumn[j];
it[column["prop"]] = column.children
.map((c) => items[c["idx"]] || " ")
.join("\n");
}
it["IDX"] = i;
//隐藏列,便于取值
if (typeof this.promptData.shadow === "object") {
for (let k in this.promptData.shadow) {
it[k] = items[this.promptData.shadow[k]];
}
}
arr.push(it);
}
return arr;
},
currentChange(currentPage) {
this.currentPage = currentPage;
},
selectEty(row, column, event) {
// 默认第一列
var idx = this.promptData.defaultColumn;
if (this.isPty) {
const v = row[this.tableColumn[idx].prop].split("\n")[0];
this.$emit("select-ety", v, this.promptData.rulePath);
} else {
const { modelUrl, isCover, rulePath } = this.promptData;
let v = {};
for (let k in modelUrl) {
row[k] && (v[k] = row[k]);
}
this.$emit("select-ety", v, modelUrl, isCover, rulePath);
}
selectEty(row) {
this.$emit("select-ety", {
...row,
role: this.promptData.type
});
this.show = false;
this.currentPage = 1;
},
......
<template>
<el-dialog
:title="promptData.title"
:visible.sync="show"
custom-class="grid-ety"
:highlight-current-row="true"
width="60%"
:before-close="beforeClose"
>
<el-table
:data="
tableData.slice((currentPage - 1) * pageSize, currentPage * pageSize)
"
border
@row-dblclick="selectEty"
>
<el-table-column
v-for="(item, idx) in tableColumn"
:key="idx"
:property="item.prop"
:label="item.label"
:width="item.width"
>
</el-table-column>
</el-table>
<el-pagination
layout="prev, pager, next, total, jumper"
:total="tableData.length"
:page-sizes="pageSizes"
:page-size="pageSize"
:current-page="currentPage"
@current-change="currentChange"
>
</el-pagination>
</el-dialog>
</template>
<script>
export default {
props: {
promptData: {
required: true,
type: Object,
default: () => {
return {
title: "",
columnStr: "",
data: [],
rulePath: "",
modelUrl: "", //非机构处理需要回填的字段路劲信息,isPty为false时必输
defaultColumn: "",
};
},
},
isPty: {
//默认为机构处理
type: Boolean,
default: true,
},
},
data() {
return {
show: false,
currentPage: 1,
pageSizes: [5, 10, 20, 30, 40, 50, 100],
pageSize: 5,
};
},
computed: {
tableColumn() {
return this.dealExtKeyTableColumn();
},
tableData() {
return this.dealExtKeyTableData();
},
},
methods: {
dealExtKeyTableColumn() {
const columnArr = [];
const lines = this.promptData.columnStr.split("\n");
const etyReg = /\"([^\"]*)\"/;
const obj = {};
for (let i = 0; i < lines.length; i++) {
let 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(/\s+/);
const positionArr = colPropArr[1].split(":");
if (!obj[positionArr[0]]) {
obj[positionArr[0]] = [];
}
obj[positionArr[0]].push({
idx: colPropArr[0],
prop: columnName,
width: colPropArr[3],
});
}
}
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);
});
},
dealExtKeyTableData() {
const arr = [];
for (let i = 0; i < this.promptData.data.length; i++) {
const d = this.promptData.data[i];
const items = d.split("\t");
const it = {};
for (let j = 0; j < this.tableColumn.length; j++) {
const column = this.tableColumn[j];
it[column["prop"]] = column.children
.map((c) => items[c["idx"]] || " ")
.join("\n");
}
it["IDX"] = i;
//隐藏列,便于取值
if (typeof this.promptData.shadow === "object") {
for (let k in this.promptData.shadow) {
it[k] = items[this.promptData.shadow[k]];
}
}
arr.push(it);
}
return arr;
},
currentChange(currentPage) {
this.currentPage = currentPage;
},
selectEty(row, column, event) {
// 默认第一列
var idx = this.promptData.defaultColumn;
if (this.isPty) {
const v = row[this.tableColumn[idx].prop].split("\n")[0];
this.$emit("select-ety", v, this.promptData.rulePath);
} else {
const { modelUrl, isCover, rulePath } = this.promptData;
let v = {};
for (let k in modelUrl) {
row[k] && (v[k] = row[k]);
}
this.$emit("select-ety", v, modelUrl, isCover, rulePath);
}
this.show = false;
this.currentPage = 1;
},
beforeClose(done) {
this.show = false;
this.currentPage = 1;
done();
},
},
};
</script>
<style>
.grid-ety .el-table .cell {
white-space: pre-wrap;
}
</style>
\ No newline at end of file
......@@ -95,7 +95,7 @@
<c-grid-ety-prompt-dialog
ref="etyDialog"
:promptData="promptData"
v-on:select-ety="selectEty"
@:select-ety="selectEty"
>
</c-grid-ety-prompt-dialog>
</c-page>
......
......@@ -309,7 +309,6 @@ export default {
}
}
list.push(...cc, ...c);
console.log('list=====', list)
},
handleOpen(index, indexPath) {
console.log('11111======', index, indexPath);
......
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