Commit c5b83c7b by wangguangchao

复核功能优化

parent e5acc24d
......@@ -88,79 +88,7 @@ export default {
}
},
async handlePass(data) {
debugger;
this.$confirm('您确定复核该笔交易?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(
async ()=>{
let idxInt = parseInt(data.idx);
const selIds = [idxInt+1]; //rowno选中行
const selDst = "trncorco.trnstm" //列表对应后台模型中的stream
let params = { selDst: selDst, selIds: selIds };
this.declareParams.trnName = "trnrel";
console.log(this);
this.model.pageId = data.pageId;
let rtnmsg = await this.executeRule("relrow", params)
if (rtnmsg.respCode == SUCCESS) {
debugger;
let errorMsg = "";
let fieldErrorsFlag = (JSON.stringify(rtnmsg.fieldErrors) == "{}");
if(!fieldErrorsFlag){
let errorMsgkey = "";
let errorMsgVal = "";
for (const key in rtnmsg.fieldErrors) {
errorMsgkey = key;
errorMsgVal = rtnmsg.fieldErrors[key];
}
errorMsg = errorMsgkey+':'+errorMsgVal;
this.$notify.error({title: '错误',message: '复核失败!错误信息['+errorMsg+']'});
}else{
this.$notify({
title: '成功',
message: '复核成功',
type: 'success'
});
debugger;
// const that = this.root;
// that.executeRule("searow").then(res => {
// //TODO 处理数据逻辑
// that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
// this.model.trncorco.trnstm = res.data.trncorco_trnstm;
// })
this.$router.history.push("/taskList", () => {
this.$store.commit("setTaskListTabVal", 'trnrel')
})
}
}
else {
let errorMsg = "";
let fieldErrorsFlag = (JSON.stringify(rtnmsg.fieldErrors) == "{}");
if(!fieldErrorsFlag){
let errorMsgkey = "";
let errorMsgVal = "";
for (const key in rtnmsg.fieldErrors) {
errorMsgkey = key;
errorMsgVal = rtnmsg.fieldErrors[key];
}
errorMsg = errorMsgkey+':'+errorMsgVal;
}else if(rtnmsg.respMsg){
errorMsg = rtnmsg.respMsg;
}
this.$notify.error({title: '错误',message: '复核失败!错误信息['+errorMsg+']'});
}
}
)
this.$store.state.Transaction.operateFuns[data.operateId]["pass"]()
},
},
};
......@@ -86,16 +86,17 @@ export default {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
},
async onHandle(idx,row) {
async onHandle(idx, row) {
let trnName = row.交易代码.toLowerCase();
let viewurl = "/review/"+trnName;
let viewurl = "/review/ditopn";
let pageId = this.model.pageId;
debugger;
const operateId = await this.$store.dispatch('Transaction/setOperateFuns', {
pass: this.onRelrow.bind(this, idx),
refuse: () => { alert("功能开发中") }
});
this.$router.push({path:viewurl,query:{routeParams: {process: "1", commitFlag: "1"},trn:row['INR'],idx:idx,pageId:pageId}});
this.$router.push({ path: viewurl, query: { routeParams: { process: "1", commitFlag: "1" }, trn: row['INR'], idx: idx, operateId: operateId } });
},
async onRelrow(idx) {
......@@ -103,62 +104,65 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async ()=>{
const selIds = [idx+1]; //rowno选中行
}).then(async () => {
const selIds = [idx + 1]; //rowno选中行
const selDst = "trncorco.trnstm" //列表对应后台模型中的stream
let params = { selDst: selDst, selIds: selIds };
let rtnmsg = await this.executeRule("relrow", params)
if (rtnmsg.respCode == SUCCESS) {
let errorMsg = "";
let fieldErrorsFlag = (JSON.stringify(rtnmsg.fieldErrors) == "{}");
if(!fieldErrorsFlag){
if (!fieldErrorsFlag) {
let errorMsgkey = "";
let errorMsgVal = "";
for (const key in rtnmsg.fieldErrors) {
errorMsgkey = key;
errorMsgVal = rtnmsg.fieldErrors[key];
}
errorMsg = errorMsgkey+':'+errorMsgVal;
this.$notify.error({title: '错误',message: '复核失败!错误信息['+errorMsg+']'});
}else{
errorMsg = errorMsgkey + ':' + errorMsgVal;
this.$notify.error({ title: '错误', message: '复核失败!错误信息[' + errorMsg + ']' });
} else {
this.$notify({
title: '成功',
message: '复核成功',
type: 'success'
});
debugger;
const that = this.root;
that.executeRule("searow").then(res => {
//TODO 处理数据逻辑
that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
this.model.trncorco.trnstm = res.data.trncorco_trnstm;
})
}
// const that = this.root;
// that.executeRule("searow").then(res => {
// //TODO 处理数据逻辑
// that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
// this.model.trncorco.trnstm = res.data.trncorco_trnstm;
// })
this.$store.dispatch("TagsView/delView", this.$route)
this.$router.history.push("/taskList", () => {
this.$store.commit("setTaskListTabVal", 'trnrel')
});
}
}
else {
let errorMsg = "";
let fieldErrorsFlag = (JSON.stringify(rtnmsg.fieldErrors) == "{}");
if(!fieldErrorsFlag){
if (!fieldErrorsFlag) {
let errorMsgkey = "";
let errorMsgVal = "";
for (const key in rtnmsg.fieldErrors) {
errorMsgkey = key;
errorMsgVal = rtnmsg.fieldErrors[key];
}
errorMsg = errorMsgkey+':'+errorMsgVal;
}else if(rtnmsg.respMsg){
errorMsg = errorMsgkey + ':' + errorMsgVal;
} else if (rtnmsg.respMsg) {
errorMsg = rtnmsg.respMsg;
}
this.$notify.error({title: '错误',message: '复核失败!错误信息['+errorMsg+']'});
this.$notify.error({ title: '错误', message: '复核失败!错误信息[' + errorMsg + ']' });
}
})
},
......@@ -348,11 +352,11 @@ export default {
// that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
// })
// } else {
// that.executeRule("searow").then(res => {
// //TODO 处理数据逻辑
// that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
// this.model.trncorco.trnstm = res.data.trncorco_trnstm;
// })
// that.executeRule("searow").then(res => {
// //TODO 处理数据逻辑
// that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
// this.model.trncorco.trnstm = res.data.trncorco_trnstm;
// })
// }
const res = await this.executeRule("searow")
const arr=[];
......@@ -377,13 +381,13 @@ export default {
});
that.$refs.inftrnps.stmData.data = arr;
this.model.trncorco.trnstm = res.data.trncorco_trnstm;
if(res.data.trncorco_trnstm.rows.length == 0){
if (res.data.trncorco_trnstm.rows.length == 0) {
this.$notify({
title: '成功',
message: '搜索完毕,无满足条件记录',
type: 'success'
});
}
}
},
async handleReset() {
......
......@@ -9,16 +9,19 @@ const mutations = {
* @param {Object} funs
* @returns
*/
ADD_OPERATE_FUN(state, funs) {
const id = Symbol("transaction-id");
ADD_OPERATE_FUN(state, { id, funs }) {
state.operateFuns[id] = funs;
return id;
},
};
const actions = {
setOperateFuns({ commit }, funs) {
commit("ADD_OPERATE_FUN", funs);
return new Promise(resolve => {
// const id = Symbol("transaction-id");
const id = new Date().valueOf();
commit('ADD_OPERATE_FUN', { id, funs })
resolve(id)
});
},
};
......
......@@ -435,7 +435,7 @@
>
处理
</c-button>
<!-- </c-button>
<c-button
style="margin-left: 0"
size="small"
......@@ -444,7 +444,7 @@
>
复核
</c-button>
</c-button> -->
......
......@@ -347,7 +347,8 @@ export default {
// 复核通过需要传递参数:复核意见和tips
// 通过 - 清空tips
data = {
pageId: this.$route.query.pageId,
// pageId: this.$route.query.pageId,
operateId: this.$route.query.operateId,
idx: this.$route.query.idx,
remark: this.remark,
tips: [] //this.$store.state.Status.highlights
......
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