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

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

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

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

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

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

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

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

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

wangguangchao committed
94 95 96 97
        const operateId = await this.$store.dispatch('Transaction/setOperateFuns', {
            pass: this.onRelrow.bind(this, idx),
            refuse: () => { alert("功能开发中") }
        });
wangguangchao committed
98

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

102
    async onWaitDetail(idx, row) {
103 104 105 106
        let viewurl = "business/inftrnpsDetail";
        const selIds = [idx + 1];
        const selDst = "trncorco.trnstm" //列表对应后台模型中的stream
        let params = { selDst, selIds };
107
        this.executeRule("dsp,reldsp",params).then((res) => {
吴佳 committed
108
            if ((res.respCode == SUCCESS)) {
109 110 111 112
                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
113
            }else{
hulei committed
114 115 116
                const h = this.$createElement;
                const msg = res.respMsg||'请求执行失败!'
                this.$notify.error({ title: '错误', message: h('p',{style: 'word-break:break-all;'}, msg) })
117 118 119 120 121 122 123 124 125 126
            }
        });
    },

    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
127
            if ((res.respCode == SUCCESS)) {
128 129 130 131
                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
132 133
            }else{
                const h = this.$createElement
hulei committed
134 135
                const msg = res.respMsg||'请求执行失败!'
                this.$notify.error({ title: '错误', message: h('p',{style: 'word-break:break-all;'}, msg) })
136 137
            }
        });
liuxin committed
138 139
    },

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

149
            let params = { selDst: selDst, selIds: selIds };
150

151 152
            let rtnmsg = await this.executeRule("relrow", params)
            if (rtnmsg.respCode == SUCCESS) {
153

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

202 203 204



205 206
        })

liuxin committed
207
    },
wangguangchao committed
208

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

221 222 223 224
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
225
    },
226 227
    async onReprow() {
        let rtnmsg = await this.executeRule("reprow")
228 229
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
230

231 232 233 234
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
235
    },
236
    async onRejrow() {
denyu committed
237 238 239
        console.log(this.getSelectedData())

        this.model.trncorco.selinr['rows'] = this.getSelectedData();
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
        let rtnmsg = await Api.post("trnrel/rejrow", this.wrapper())
        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
265
    },
266 267
    async onRelcor() {
        let rtnmsg = await this.executeRule("relcor")
268 269
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
270

271 272 273 274
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
275
    },
276 277
    async onExi() {
        let rtnmsg = await this.executeRule("exi")
278 279
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
280

281 282 283 284
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
285
    },
286

287 288
    async onRecpanDet() {
        let rtnmsg = await this.executeRule("recpan_det")
289 290
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
291

292 293 294 295
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
296
    },
297 298
    async onSyswrnButshw() {
        let rtnmsg = await this.executeRule("syswrn_butshw")
299 300
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
301

302 303 304 305
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
306
    },
307 308
    async onRecpanNotmap() {
        let rtnmsg = await this.executeRule("recpan_notmap")
309 310
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
311

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

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

332 333 334 335
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
336
    },
337 338
    async onRecpanButord() {
        let rtnmsg = await this.executeRule("recpan_butord")
339 340
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
341

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

352 353 354 355
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
356
    },
357
    async onRecpanIncben() {
358
        let rtnmsg = await this.executeRule("recpan_incben")
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 onInftxtButtxmsel() {
        let rtnmsg = await this.executeRule("inftxt_buttxmsel")
369 370
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
371

372 373 374 375
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
376 377
    },
    onSeainf() {
liuxin committed
378

denyu committed
379
    },
liuxin committed
380 381 382 383 384 385
    // display(index, row) {
    //     const d = this.stmData.data[index]
    //     const ds = d.split("\t")
    //     let viewurl = "/#/display/" + ds['10'].toLowerCase() + "?trn=" + ds['1']
    //     window.open(viewurl, 'newwindow', 'height=1200,width=900,top=100,left=100,toolbar=no,resizable=no,menubar=no,location=no, status=no');
    // },
386 387
    async handleSearch() {
        const that = this.root;
388 389 390 391 392 393
        // if (this.model.searchAllUsers) {
        //     that.executeRule("seajbh").then(res => {
        //         //TODO 处理数据逻辑
        //         that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
        //     })
        // } else {
394 395 396 397 398
        // that.executeRule("searow").then(res => {
        //     //TODO 处理数据逻辑
        //     that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
        //     this.model.trncorco.trnstm = res.data.trncorco_trnstm;
        // })
399
        // }
liushikai committed
400 401 402
        if(this.model.trncorco.relflg == ''){
            this.model.trncorco.relflg = '0';
        }
403
        const res = await this.executeRule("inftrnps,searow")
liushikai committed
404
        that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
liushikai committed
405
        this.model.trncorco.trnstm = res.data.trncorco_trnstm;
406
        this.$store.commit("setTaskList", {key: "trnrel", val: this.stmData.data.length});
liushikai committed
407 408 409 410 411 412 413
        // if (res.data.trncorco_trnstm.rows.length == 0) {
        //     this.$notify({
        //         title: '成功',
        //         message: '搜索完毕,无满足条件记录',
        //         type: 'success'
        //     });
        // }
414
        this.$refs.paramsForm.clearValidate();
潘际乾 committed
415
        Utils.positioningErrorMsg(res.fieldErrors, this.$refs.paramsForm.fields)
416
    },
417 418
    async trnfndhandleSearch() {
        const that = this.root;
liushikai committed
419 420 421
        if(this.model.trncorco.relflg == ''){
            this.model.trncorco.relflg = '1';
        }
422
        const res = await this.executeRule("inftrnps,searow")
423 424 425 426 427 428
        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)
    },
429

430
    async handleReset() {
431 432
        this.model.bchcon = "";
        this.model.trncorco.ownref = "";
liuxin committed
433
        this.model.trncorco.relflg = "ALL";
434 435 436 437 438 439 440
        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;
441 442
    },

443

444

liuxin committed
445
}