Commit c5b83c7b by wangguangchao

复核功能优化

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