Event.js 17.1 KB
Newer Older
liuxin committed
1
import Api from "~/service/Api"
潘际乾 committed
2
import { rejrow, reprow } from "~/service/business/trnrel"
liuxin committed
3
import Utils from "~/utils/index"
liuxin committed
4
export default {
5 6
    async onSeaown() {
        const that = this.root;
7 8 9 10 11
        that.executeRule("searow").then(res => {
            //TODO 处理数据逻辑
            that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
            this.model.trncorco.trnstm = res.data.trncorco_trnstm;
        })
liuxin committed
12
    },
13 14
    async onSeajbh() {
        const that = this.root;
15 16 17 18
        that.executeRule("seajbh").then(res => {
            //TODO 处理数据逻辑
            that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
        })
liuxin committed
19
    },
20 21
    async onSeactr() {
        let rtnmsg = await this.executeRule("seactr")
22 23
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
24

25 26 27 28
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
29
    },
30 31
    async onSearow() {
        let rtnmsg = await this.executeRule("searow")
32 33
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
34

35 36 37 38
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
39
    },
40 41
    async onDsp() {
        let rtnmsg = await this.executeRule("dsp")
42 43
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
44

45 46 47 48
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
49
    },
50 51
    async onImgmodNewimg() {
        let rtnmsg = await this.executeRule("imgmod_newimg")
潘际乾 committed
52
        if (rtnmsg.respCode == SUCCESS) {
53
            //TODO 处理数据逻辑
liuxin committed
54

55 56 57 58
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
59
    },
60 61
    async onImgmodNewhisimg() {
        let rtnmsg = await this.executeRule("imgmod_newhisimg")
62 63
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
64

65 66 67 68
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
69
    },
70 71
    async onDiaconButdia() {
        let rtnmsg = await this.executeRule("diacon_butdia")
72 73
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
74

75 76 77 78
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
79
    },
80 81
    async onImgmodHisimg() {
        let rtnmsg = await this.executeRule("imgmod_hisimg")
82 83
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
84

85 86 87 88
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
89
    },
90
    async onHandle(idx, row) {
91

wangguangchao committed
92 93
        let trnName = row.交易代码.toLowerCase();
        let viewurl = "/review/"+trnName;
wangguangchao committed
94

liuxin committed
95 96 97
        console.log(idx);
        console.log(row);

wangguangchao committed
98 99
        const operateId = await this.$store.dispatch('Transaction/setOperateFuns', {
            pass: this.onRelrow.bind(this, idx),
潘际乾 committed
100
            refuse: this.onReprow.bind(this, idx),
wangguangchao committed
101
        });
wangguangchao committed
102

wangguangchao committed
103
        this.$router.push({ path: viewurl, query: { trn: row['INR'],  operateId: operateId } });
wangguangchao committed
104 105
    },

106
    async onWaitDetail(idx, row) {
107 108 109 110
        let viewurl = "business/inftrnpsDetail";
        const selIds = [idx + 1];
        const selDst = "trncorco.trnstm" //列表对应后台模型中的stream
        let params = { selDst, selIds };
111
        this.executeRule("dsp,reldsp",params).then((res) => {
吴佳 committed
112
            if ((res.respCode == SUCCESS)) {
113 114 115 116
                Utils.copyValueFromVO(this.model, res.data);
                sessionStorage.setItem('InftrnpsDetail', JSON.stringify(this.model));
                // this.$router.push({ path: "business/inftrnpsDetail", query: { idx: idx}});
                this.$router.push({ path: viewurl, query: {} });
hulei committed
117
            }else{
hulei committed
118 119 120
                const h = this.$createElement;
                const msg = res.respMsg||'请求执行失败!'
                this.$notify.error({ title: '错误', message: h('p',{style: 'word-break:break-all;'}, msg) })
121 122 123 124 125 126 127 128 129 130
            }
        });
    },

    async onFinishDetail(idx, row) {
        let viewurl = "business/trnfndsDetail";
        const selIds = [idx + 1];
        const selDst = "trncorco.trnstm" //列表对应后台模型中的stream
        let params = { selDst, selIds };
        this.executeRule("dsp,reldsp",params).then((res) => {
吴佳 committed
131
            if ((res.respCode == SUCCESS)) {
132 133 134 135
                Utils.copyValueFromVO(this.model, res.data);
                sessionStorage.setItem('InftrnpsDetail', JSON.stringify(this.model));
                // this.$router.push({ path: "business/inftrnpsDetail", query: { idx: idx}});
                this.$router.push({ path: viewurl, query: {} });
hulei committed
136 137
            }else{
                const h = this.$createElement
hulei committed
138 139
                const msg = res.respMsg||'请求执行失败!'
                this.$notify.error({ title: '错误', message: h('p',{style: 'word-break:break-all;'}, msg) })
140 141
            }
        });
liuxin committed
142 143
    },

wangguangchao committed
144
    async onRelrow(idx) {
145 146 147 148
        this.$confirm('您确定复核该笔交易?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
149 150
        }).then(async () => {
            const selIds = [idx + 1]; //rowno选中行
151
            const selDst = "trncorco.trnstm" //列表对应后台模型中的stream
152

153
            let params = { selDst: selDst, selIds: selIds };
154

155 156
            let rtnmsg = await this.executeRule("relrow", params)
            if (rtnmsg.respCode == SUCCESS) {
157

158 159
                let errorMsg = "";
                let fieldErrorsFlag = (JSON.stringify(rtnmsg.fieldErrors) == "{}");
160
                if (!fieldErrorsFlag) {
161 162 163 164 165 166
                    let errorMsgkey = "";
                    let errorMsgVal = "";
                    for (const key in rtnmsg.fieldErrors) {
                        errorMsgkey = key;
                        errorMsgVal = rtnmsg.fieldErrors[key];
                    }
167 168 169
                    errorMsg = errorMsgkey + ':' + errorMsgVal;
                    this.$notify.error({ title: '错误', message: '复核失败!错误信息[' + errorMsg + ']' });
                } else {
170 171 172 173 174
                    this.$notify({
                        title: '成功',
                        message: '复核成功',
                        type: 'success'
                    });
wangguangchao committed
175 176 177 178 179 180 181 182
                    // 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", () => {
183 184
                        this.$store.commit("setTaskListTabVal", 'trnrel');
                        this.handleSearch()
wangguangchao committed
185
                    });
186
                }
187 188 189 190
            }
            else {
                let errorMsg = "";
                let fieldErrorsFlag = (JSON.stringify(rtnmsg.fieldErrors) == "{}");
191
                if (!fieldErrorsFlag) {
192 193 194 195 196
                    let errorMsgkey = "";
                    let errorMsgVal = "";
                    for (const key in rtnmsg.fieldErrors) {
                        errorMsgkey = key;
                        errorMsgVal = rtnmsg.fieldErrors[key];
197
                        errorMsg = errorMsg + errorMsgkey + ':' + errorMsgVal + ";";
198
                    }
199
                   
200
                } else if (rtnmsg.respMsg) {
201
                    errorMsg = rtnmsg.respMsg;
202
                }
203
                this.$notify.error({ title: '错误', message: '复核失败!错误信息[' + errorMsg + ']' });
204
            }
wangguangchao committed
205

206 207 208



209 210
        })

liuxin committed
211
    },
wangguangchao committed
212

213
    sleep(ms) {
wangguangchao committed
214
        return new Promise((resolve, reject) => {
215 216 217
            setTimeout(() => {
                resolve()
            }, ms)
wangguangchao committed
218
        })
219 220
    },
    async onPrinte() {
221
        let rtnmsg = await this.executeRule("printe")
222 223
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
224

225 226 227 228
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
229
    },
潘际乾 committed
230 231 232 233 234 235 236 237
    async onReprow(idx) {
        this.$confirm('您确定退回该笔交易?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
        }).then(async () => {
            const selIds = [idx + 1]; //rowno选中行
            const selDst = "trncorco.trnstm" //列表对应后台模型中的stream
liuxin committed
238

潘际乾 committed
239 240
            let params = { selDst: selDst, selIds: selIds };

潘际乾 committed
241
            let rtnmsg = await reprow(this.wrapper(params))
潘际乾 committed
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
            if (rtnmsg.respCode == SUCCESS) {

                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'
                    });
                    this.$store.dispatch("TagsView/delView", this.$route)
                    this.$router.history.push("/taskList", () => {
                        this.$store.commit("setTaskListTabVal", 'trnrel');
                        this.handleSearch()
                    });
                }
            }
            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 = errorMsg + errorMsgkey + ':' + errorMsgVal + ";";
                    } 
                } else if (rtnmsg.respMsg) {
                    errorMsg = rtnmsg.respMsg;
                }
                this.$notify.error({ title: '错误', message: '退回失败!错误信息[' + errorMsg + ']' });
            }
        })
liuxin committed
285
    },
286
    async onRejrow() {
denyu committed
287 288 289
        console.log(this.getSelectedData())

        this.model.trncorco.selinr['rows'] = this.getSelectedData();
潘际乾 committed
290
        let rtnmsg = await rejrow(this.wrapper())
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
            // var cacheFileName = rtnmsg.data.cacheFileName;
            // let rejrowRtnmsg = await Api.post("trncor/init", {params:{"cacheFileName":cacheFileName}})
            // if(rejrowRtnmsg.respCode == SUCCESS){
            //     this.$message({
            //         type: 'success',
            //         message: 'Reject成功!'
            //     });
            //     await this.sleep(2000);
            //     this.$router.go(0);
            // }

            this.$message({
                type: 'success',
                message: 'Reject成功!'
            });
            // await this.sleep(2000);
            // this.$router.go(0);

        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
315
    },
316 317
    async onRelcor() {
        let rtnmsg = await this.executeRule("relcor")
318 319
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
320

321 322 323 324
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
325
    },
326 327
    async onExi() {
        let rtnmsg = await this.executeRule("exi")
328 329
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
330

331 332 333 334
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
335
    },
336

337 338
    async onRecpanDet() {
        let rtnmsg = await this.executeRule("recpan_det")
339 340
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
341

342 343 344 345
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
346
    },
347 348
    async onSyswrnButshw() {
        let rtnmsg = await this.executeRule("syswrn_butshw")
349 350
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
351

352 353 354 355
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
356
    },
357 358
    async onRecpanNotmap() {
        let rtnmsg = await this.executeRule("recpan_notmap")
359 360
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
361

362 363 364 365
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
366
    },
367 368
    async onRecpanButspt() {
        let rtnmsg = await this.executeRule("recpan_butspt")
369 370
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
371

372 373 374 375
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
376
    },
377 378
    async onRecpanInc() {
        let rtnmsg = await this.executeRule("recpan_inc")
379 380
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
381

382 383 384 385
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
386
    },
387 388
    async onRecpanButord() {
        let rtnmsg = await this.executeRule("recpan_butord")
389 390
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
391

392 393 394 395
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
396
    },
397
    async onImgmodImage() {
398
        let rtnmsg = await this.executeRule("imgmod_image")
399 400
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
401

402 403 404 405
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
406
    },
407
    async onRecpanIncben() {
408
        let rtnmsg = await this.executeRule("recpan_incben")
409 410
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
411

412 413 414 415
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
416
    },
417 418
    async onInftxtButtxmsel() {
        let rtnmsg = await this.executeRule("inftxt_buttxmsel")
419 420
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
421

422 423 424 425
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
426 427
    },
    onSeainf() {
liuxin committed
428

denyu committed
429
    },
430 431
    async handleSearch() {
        const that = this.root;
432 433 434 435 436 437
        // if (this.model.searchAllUsers) {
        //     that.executeRule("seajbh").then(res => {
        //         //TODO 处理数据逻辑
        //         that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
        //     })
        // } else {
438 439 440 441 442
        // that.executeRule("searow").then(res => {
        //     //TODO 处理数据逻辑
        //     that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
        //     this.model.trncorco.trnstm = res.data.trncorco_trnstm;
        // })
443
        // }
liushikai committed
444 445 446
        if(this.model.trncorco.relflg == ''){
            this.model.trncorco.relflg = '0';
        }
447
        const res = await this.executeRule("inftrnps,searow")
liushikai committed
448
        that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
liushikai committed
449
        this.model.trncorco.trnstm = res.data.trncorco_trnstm;
450
        this.$store.commit("setTaskList", {key: "trnrel", val: this.stmData.data.length});
liushikai committed
451 452 453 454 455 456 457
        // if (res.data.trncorco_trnstm.rows.length == 0) {
        //     this.$notify({
        //         title: '成功',
        //         message: '搜索完毕,无满足条件记录',
        //         type: 'success'
        //     });
        // }
458
        this.$refs.paramsForm.clearValidate();
潘际乾 committed
459
        Utils.positioningErrorMsg(res.fieldErrors, this.$refs.paramsForm.fields)
460
    },
461 462
    async trnfndhandleSearch() {
        const that = this.root;
liushikai committed
463 464 465
        if(this.model.trncorco.relflg == ''){
            this.model.trncorco.relflg = '1';
        }
466
        const res = await this.executeRule("inftrnps,searow")
467 468 469 470 471 472
        that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
        this.model.trncorco.trnstm = res.data.trncorco_trnstm;
 
        this.$refs.paramsForm.clearValidate();
        Utils.positioningErrorMsg(res.fieldErrors, this.$refs.paramsForm.fields)
    },
473

474
    async handleReset() {
475 476
        this.model.bchcon = "";
        this.model.trncorco.ownref = "";
liuxin committed
477
        this.model.trncorco.relflg = "ALL";
478 479 480 481 482 483 484
        this.model.usrcon = "";
        this.model.trncorco.inidatfro = "";
        this.model.trncorco.inidattil = "";
        this.model.atp.cod = "";
        this.model.trncorco.dflg = "ALL";
        this.model.atptxt = "";
        this.model.searchAllUsers = false;
485 486
    },

487

488

liuxin committed
489
}