Commit 204bc1fb by 潘际乾

前端需求改进

parent 344b3578
......@@ -59,6 +59,8 @@ export default {
if(result.respCode != SUCCESS) {
this.$notify.error({title: '错误',message: result.respMsg});
} else {
// 清除之前的校验状态
this.getVM().$refs.modelForm.clearValidate()
const fields = this.getVM().$refs.modelForm.fields
const fieldErrors = result.fieldErrors;
Utils.positioningErrorMsg(fieldErrors, fields)
......@@ -66,9 +68,9 @@ export default {
},
exit(){
this.$confirm('您有未保存的数据,确定退出吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(()=>{
this.$router.history.push("/business/office")
})
......
......@@ -4,10 +4,10 @@ import commonApi from "./commonApi"
import Utils from "~/utils"
export default {
mixins: [commonApi,commonDeclare],
mixins: [commonApi, commonDeclare],
data: function () {
return {
defFlag:true,
defFlag: true,
// 弹框回填
promptData: {
title: '',
......@@ -20,22 +20,22 @@ export default {
created() {
},
mounted() {
if(!this.isInDisplay){
if (!this.isInDisplay) {
// this.ruleWatcher()
this.ruleCheck()
}
},
methods: {
openWatch(flag){
openWatch(flag) {
this.defFlag = !!flag
},
ruleWatcher() {
if(!this.defaultRules)
if (!this.defaultRules)
return
const that = this;
Object.keys(that.defaultRules).forEach(key => {
let func = function(){
if(that.defFlag){
let func = function () {
if (that.defFlag) {
that.defaultRules[key].apply(that)
}
}
......@@ -43,7 +43,7 @@ export default {
})
},
ruleCheck() {
if(!this.pattern)
if (!this.pattern)
return
// const keySet = new Set(Object.keys(this.pattern).concat(Object.keys(this.checkRules).concat(Object.keys(this.defaultRules))))
const keySet = new Set(Object.keys(this.pattern).concat(Object.keys(this.defaultRules)))
......@@ -51,7 +51,7 @@ export default {
const that = this;
for (let key of keySet.keys()) {
const rule = []
if(that.pattern[key]){
if (that.pattern[key]) {
rule.push(...that.pattern[key])
}
const triggerType = that.getTriggerType(key)
......@@ -77,7 +77,7 @@ export default {
trigger: triggerType
})
}
if(rule.length > 0) {
if (rule.length > 0) {
res[key] = rule;
}
}
......@@ -98,6 +98,42 @@ export default {
return "blur";
},
/**
* Tabs切换事件
* @param {VM} tab
*/
tabClick(tab) {
if (this.isInDisplay) {
return
}
const name = tab.name
let rulePath;
if (name === "setpan") {
rulePath = "setmod.setpan";
}
if (name === "glepan") {
rulePath = "setmod.glemod.glepan";
}
if (name === "docpan") {
rulePath = "trnmod.trndoc.docpan"
}
if (name === "doctre") {
rulePath = "trnmod.trndoc.doctre"
}
if (name === "engp") {
rulePath = "liaall.engp"
}
if (name === "limitbody") {
rulePath = "liaall.limmod.limitbody"
}
if (!!rulePath) {
this.executeRule(rulePath).then(res => {
if (res.respCode == SUCCESS) {
this.updateModel(res.data)
}
})
}
},
/**
* 以函数形式获取model(请求参数),保证取到的是最新赋值的
* @param {any} params 参数
* @returns
......@@ -105,15 +141,15 @@ export default {
wrapper(params) {
params = params || {}
const fn = async () => {
const that = this;
const data = await new Promise(resolve => {
// 保证前一次请求结果赋值VO完成
setTimeout(() => {
const d = Utils.flatObject(that.model)
resolve(d)
}, 0)
})
return {...data, params}
const that = this;
const data = await new Promise(resolve => {
// 保证前一次请求结果赋值VO完成
setTimeout(() => {
const d = Utils.flatObject(that.model)
resolve(d)
}, 0)
})
return { ...data, params }
}
return fn;
},
......@@ -124,37 +160,54 @@ export default {
updateModel(data) {
Utils.copyValueFromVO(this.model, data);
},
/**
* 弹出机构选择框
* @param {String} rulePath 路径
*/
showGridPromptDialog(rulePath) {
this.executeRule(rulePath).then((res) => {
if (res.respCode = SUCCESS){
if (res.respCode = SUCCESS) {
if (res.data.params) {
Utils.copyValueFromVO(this.model, res.data);
Utils.copyValueFromVO(this.model, res.data);
} else {
this.root.$refs.etyDialog.show = true
this.root.promptData = {
title: res.data.title,
columnStr: res.data.columns,
data: res.data.vals.rows,
rulePath: rulePath,
}
this.root.$refs.etyDialog.show = true
this.root.promptData = {
title: res.data.title,
columnStr: res.data.columns,
data: res.data.vals.rows,
rulePath: rulePath,
}
}
}
})
},
/**
* 机构回填
* @param {String} val 选种行的值(一般是首列)
* @param {String} rulePath 路径
*/
selectEty(val, rulePath) {
const props = rulePath.replaceAll(".", "_")
const obj = {}
obj[props] = val;
Utils.copyValueFromVO(this.model, obj);
this.executeRule(rulePath).then((res) => {
if (res.respCode = SUCCESS){
if (res.respCode = SUCCESS) {
Utils.copyValueFromVO(this.model, res.data);
}
});
},
/**
* 改变表单项的是否必填属性
* @param {String} property 属性
* @param {Boolean} required 是否必填
*/
changeFormItemRequired(property, required) {
this.pattern[property][0].required = required
}
},
computed:{
isInDisplay(){
computed: {
isInDisplay() {
return this.$store.state.Status.mode === 'display'
}
}
......
......@@ -164,7 +164,7 @@ export default class Cptopn{
setfel:[]
},
glemod:{
gleshwstm: {}
}
},
mtabut:{
......
......@@ -187,6 +187,9 @@ export default class Ditopn{
},
setfeg:{
setfel:[]
},
glemod:{
gleshwstm: {}
}
},
liaall:{
......
......@@ -51,10 +51,6 @@ export default {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
},
tabClick() {
},
async continueEdit(row) {
//let rtnmsg = await Api.post("getPendingData",{params:{'selsptinr':row[0]}})
//if (rtnmsg.respCode == SUCCESS) {
......
......@@ -10,60 +10,60 @@
:validate-on-rule-change="false"
>
<el-tabs ref="elment" type="card" @tab-click="tabClick">
<el-tab-pane label="Overview">
<el-tab-pane label="Overview" name="opnp1">
<!--PD000020 -->
<m-opnp1 :model="model" :codes="codes" />
</el-tab-pane>
<el-tab-pane label="Settlement">
<el-tab-pane label="Settlement" name="setpan">
<!--PD000000 -->
<m-setpan :model="model" :codes="codes" />
</el-tab-pane>
<el-tab-pane label="Bookings">
<el-tab-pane label="Bookings" name="glepan">
<!--PD000001 -->
<m-glepan :model="model" :codes="codes" ref="glepan"/>
</el-tab-pane>
<el-tab-pane label="Completion">
<el-tab-pane label="Completion" name="coninfp">
<!--PD000000 -->
<m-coninfp :model="model" :codes="codes" />
</el-tab-pane>
<el-tab-pane label="Messages">
<el-tab-pane label="Messages" name="docpan">
<!--PD000529 -->
<m-docpan :model="model" :codes="codes" />
</el-tab-pane>
<el-tab-pane label="Attachments">
<el-tab-pane label="Attachments" name="doctre">
<!--PD000546 -->
<m-doctre :model="model" :codes="codes" />
</el-tab-pane>
<el-tab-pane label="Finance">
<el-tab-pane label="Finance" name="finp">
<!--PD000218 -->
<m-finp :model="model" :codes="codes" />
</el-tab-pane>
<el-tab-pane label="外管信息">
<el-tab-pane label="外管信息" name="wg">
<!--PD000009 -->
<m-wg :model="model" :codes="codes"/>
</el-tab-pane>
<el-tab-pane label="境内汇款申请书-基础信息" v-if="model.bopmod.szflg === '2' && model.bopmod.basflg">
<el-tab-pane label="境内汇款申请书-基础信息" name="dbe" v-if="model.bopmod.szflg === '2' && model.bopmod.basflg">
<m-dbe :model="model" :codes="codes"></m-dbe>
</el-tab-pane>
<el-tab-pane label="境外汇款申请书-基础信息" v-if="model.bopmod.szflg === '1' && model.bopmod.basflg">
<el-tab-pane label="境外汇款申请书-基础信息" name="dbb" v-if="model.bopmod.szflg === '1' && model.bopmod.basflg">
<m-dbb :model="model" :codes="codes"></m-dbb>
</el-tab-pane>
<el-tab-pane label="跨境人民币申报">
<el-tab-pane label="跨境人民币申报" name="cnyp">
<!--PD000002 -->
<m-cnyp :model="model" :codes="codes"/>
</el-tab-pane>
<el-tab-pane label="2111跨境支出信息" v-if="model.cnybop.outflg==='1'">
<el-tab-pane label="2111跨境支出信息" name="outp" v-if="model.cnybop.outflg==='1'">
<m-outp :model="model" :codes="codes"></m-outp>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
<c-bus-button :$pntvm="this"></c-bus-button>
</el-form>
......@@ -82,10 +82,7 @@ import Pattern from "~/model/Cptopn/Pattern";
import Default from "~/model/Cptopn/Default";
import Check from "~/model/Cptopn/Check";
import Opnp1 from "./Opnp1";
import Setpan from "./Setpan";
import Glepan from "./Glepan";
import Coninfp from "./Coninfp";
import Docpan from "./Docpan";
import Doctre from "./Doctre";
import Finp from "./Finp";
import Wg from "./Wg";
......@@ -94,6 +91,10 @@ import Dbe from "./Dbe.vue"
import Dbb from "./Dbb.vue"
import Outp from "./Outp.vue"
import Glepan from "~/views/Public/Glepan"
import Setpan from "~/views/Public/Setpan"
import Docpan from "~/views/Public/Docpan"
export default {
components: {
"m-opnp1": Opnp1,
......@@ -126,53 +127,8 @@ export default {
codes: {...CodeTable},
};
},
methods:{
tabClick(vm){
if(this.isInDisplay){
return
}
const label = vm.label
if (label === "Settlement") {
this.executeRule("setmod.setpan").then(res => {
if (res.respCode == SUCCESS){
const data = res.data;
Utils.copyValueFromVO(this.model, data)
}
})
}
if (label === "Bookings") {
this.executeRule("setmod.glemod.glepan").then(res => {
const data = res.data;
this.$refs.glepan.stmData.data = res.data.setmod_glemod_gleshwstm.rows;
})
}
if (label === "Messages") {
this.executeRule("trnmod.trndoc.docpan").then(res => {
if (res.respCode == SUCCESS){
const data = res.data;
Utils.copyValueFromVO(this.model, data)
var stm = [];
let k = 0;
for(let i = 0; i < res.data.trnmod_trndoc_doceot.length; i++){
if(res.data.trnmod_trndoc_doceot[i].role != ""){
stm[k++] = res.data.trnmod_trndoc_doceot[i];
}
}
this.$refs.docpan.stmData.data = stm
}
})
}
if (label === "Attachments") {
this.executeRule("trnmod.trndoc.doctre").then(res => {
if (res.respCode == SUCCESS){
const data = res.data;
Utils.copyValueFromVO(this.model, data)
}
})
}
}
},
methods:{
},
created: async function () {
console.log("进入cptopn交易");
let rtnmsg = await Api.post("cptopn/init", { params: {} });
......
......@@ -2,7 +2,7 @@
<c-page title="汇出汇款">
<div class="eContainer">
<el-form :model="model" :rules="rules" ref="modelForm" label-width="150px" size="small">
<el-tabs v-model="activeName" type="card" @tab-click="onTabClick">
<el-tabs v-model="activeName" type="card" @tab-click="tabClick">
<el-tab-pane label="概况" name="basic">
<m-basic v-bind:model="model"/>
</el-tab-pane>
......@@ -2392,10 +2392,6 @@ export default {
}
},
methods:{
onTabClick(tab, event){
},
onUsrcon(){
this.$refs.modelForm.validate(async valid => {
if(!valid)
......
......@@ -2007,7 +2007,6 @@ export default {
};
},
methods: {
tabClick(vm) {},
},
created: async function () {
console.log("进入ditame交易");
......
<!--
<template>
<div class="eibs-tab">
<c-col :span="22" :offset="1">
......@@ -44,3 +46,5 @@ export default {
<style>
</style>
-->
\ No newline at end of file
......@@ -366,9 +366,7 @@ export default {
set:function (value) {
this.$parent.$parent.dialogVisible2 =value;
}
}
}
}
};
</script>
......
......@@ -117,14 +117,15 @@ import Mt799 from "./Mt799"
import Litbenl1 from "./Litbenl1"
import Litapll1 from "./Litapll1"
import Litrmbl1 from "./Litrmbl1"
import Setpan from "./Setpan"
import Engp from "./Engp"
import Addbcb from "./Addbcb"
import Docpan from "./Docpan"
import Limitbody from "./Limitbody"
import Coninfp from "./Coninfp"
import Ccvpan from "./Ccvpan"
import Glepan from "./Glepan"
import Glepan from "~/views/Public/Glepan"
import Setpan from "~/views/Public/Setpan"
import Docpan from "~/views/Public/Docpan"
export default {
......@@ -170,57 +171,6 @@ export default {
}
},
methods:{
tabClick(vm){
if(this.isInDisplay){
return
}
const name = vm.name
if (name === "engp") {
this.executeRule("liaall.engp").then(res => {
const data = res.data;
Utils.copyValueFromVO(this.model, data)
})
}
if (name === "glepan") {
this.executeRule("setmod.glemod.glepan").then(res => {
const data = res.data;
this.$refs.glepan.stmData.data = res.data.setmod_glemod_gleshwstm.rows;
//Utils.copyValueFromVO(this.model, data)
})
}
if (name === "setpan") {
this.executeRule("setmod.setpan").then(res => {
if (res.respCode == SUCCESS){
const data = res.data;
Utils.copyValueFromVO(this.model, data)
}
})
}
if (name === "docpan") {
this.executeRule("trnmod.trndoc.docpan").then(res => {
if (res.respCode == SUCCESS){
const data = res.data;
Utils.copyValueFromVO(this.model, data)
var stm = [];
let k = 0;
for(let i = 0; i < res.data.trnmod_trndoc_doceot.length; i++){
if(res.data.trnmod_trndoc_doceot[i].role != ""){
stm[k++] = res.data.trnmod_trndoc_doceot[i];
}
}
this.$refs.docpan.stmData.data = stm
}
})
}
if (name === "limitbody") {
this.executeRule("liaall.limmod.limitbody").then(res => {
if (res.respCode == SUCCESS){
const data = res.data;
Utils.copyValueFromVO(this.model, data)
}
})
}
}
},
mounted:async function(){
console.log("进入ditopn交易");
......@@ -240,22 +190,20 @@ export default {
this.$notify.error({title: '错误',message: '服务请求失败!'});
}
},
computed:{
flg(){
return this.model.didgrp.rec.elcflg
},
avbby(){
return this.model.didgrp.rec.avbby
}
},
watch:{
flg(){
this.pattern["didgrp.rec.fenctg"][0].required = this.model.didgrp.rec.elcflg == "Y";
},
avbby(){
this.pattern["didgrp.rec.tenmaxday"][0].required = this.model.didgrp.rec.avbby == "D";
// 动态修改属性的必填属性
"model.didgrp.rec.elcflg": {
handler(val, oldVal) {
this.changeFormItemRequired("didgrp.rec.fenctg", val == "Y")
},
immediate: true
},
"model.didgrp.rec.avbby": {
handler(val, oldVal) {
this.changeFormItemRequired("didgrp.rec.tenmaxday", val == "D")
},
immediate: true
}
}
}
</script>
......
......@@ -536,7 +536,6 @@ export default {
};
},
methods: {
tabClick(){},
},
created: async function () {
console.log("进入ditsel交易");
......
......@@ -167,8 +167,6 @@ export default {
}
},
methods:{
tabClick(){}
},
created:async function(){
console.log("进入infpta交易");
......
......@@ -182,12 +182,9 @@ export default {
}
},
methods:{
handleClick(index, row){
console.log(index)
},
tabClick(){
}
handleClick(index, row){
console.log(index)
},
},
mounted:async function(){
......
......@@ -542,9 +542,6 @@ export default {
}
})
},
tabClick(){
},
},
mounted:async function(){
console.log("进入trndtl交易");
......
......@@ -65,9 +65,6 @@ export default {
}
},
methods:{
tabClick(){
}
},
mounted:async function(){
console.log("进入trnrel交易");
......
<template>
<div class="eibs-tab">
<c-col :span="22" :offset="1">
<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 Event from "~/model/Ditopn/Event"
export default {
inject: ['root'],
mixins: [CommonProcess],
props:["model","codes"],
data(){
return {
columns: [
"2 1 \"D/C\" 38 1 0",
"6 2 \"Account Number\" 140",
"3 3 \"Cur\" 60",
"4 4 \"Amount\" 135 2 8:1 2 5",
"5 5 \"Value Date\" 80",
"7 6 \"Rate Type\" 90",
"8 7 \"Rate\" 85 2 0 1 0",
"9 8 \"Term\" 60",
"0 9 \"PN\" 62 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
}
},
methods:{...Event},
created:function(){
}
}
</script>
<style>
</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