Event.js 12.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
    },
wangguangchao committed
89
    async onHandle(idx,row) {
90

wangguangchao committed
91 92 93 94 95 96 97 98 99 100 101

        let viewurl = "/review/ditopn";

        let pageId = this.model.pageId;
        debugger;

        this.$router.push({path:viewurl,query:{routeParams: {process: "1", commitFlag: "1"},trn:row['INR'],idx:idx,pageId:pageId}});
       
    },

    async onRelrow(idx) {
102 103 104 105 106 107 108 109 110
        this.$confirm('您确定复核该笔交易?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
        }).then(async ()=>{
            const selIds = [idx+1]; //rowno选中行
            const selDst = "trncorco.trnstm" //列表对应后台模型中的stream
    
            let params = { selDst: selDst, selIds: selIds };
111
            
wangguangchao committed
112
                
113 114
            let rtnmsg = await this.executeRule("relrow", params)
            if (rtnmsg.respCode == SUCCESS) {
115
            
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
                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;
                    })
                }         
            }
            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;
155
                }
156
                this.$notify.error({title: '错误',message: '复核失败!错误信息['+errorMsg+']'});
157
            }
wangguangchao committed
158

159
            
wangguangchao committed
160 161
        
    
162 163
        })

liuxin committed
164
    },
wangguangchao committed
165

166
    sleep(ms) {
wangguangchao committed
167
        return new Promise((resolve, reject) => {
168 169 170
            setTimeout(() => {
                resolve()
            }, ms)
wangguangchao committed
171
        })
172 173
    },
    async onPrinte() {
174
        let rtnmsg = await this.executeRule("printe")
175 176
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
177

178 179 180 181
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
182
    },
183 184
    async onReprow() {
        let rtnmsg = await this.executeRule("reprow")
185 186
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
187

188 189 190 191
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
192
    },
193
    async onRejrow() {
denyu committed
194 195 196
        console.log(this.getSelectedData())

        this.model.trncorco.selinr['rows'] = this.getSelectedData();
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
        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
222
    },
223 224
    async onRelcor() {
        let rtnmsg = await this.executeRule("relcor")
225 226
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
227

228 229 230 231
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
232
    },
233 234
    async onExi() {
        let rtnmsg = await this.executeRule("exi")
235 236
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
237

238 239 240 241
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
242
    },
243

244 245
    async onRecpanDet() {
        let rtnmsg = await this.executeRule("recpan_det")
246 247
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
248

249 250 251 252
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
253
    },
254 255
    async onSyswrnButshw() {
        let rtnmsg = await this.executeRule("syswrn_butshw")
256 257
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
258

259 260 261 262
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
263
    },
264 265
    async onRecpanNotmap() {
        let rtnmsg = await this.executeRule("recpan_notmap")
266 267
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
268

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

279 280 281 282
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
283
    },
284 285
    async onRecpanInc() {
        let rtnmsg = await this.executeRule("recpan_inc")
286 287
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
liuxin committed
288

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

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

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

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

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

denyu committed
336
    },
337
    display(index, row) {
潘际乾 committed
338 339
        const d = this.stmData.data[index]
        const ds = d.split("\t")
340
        let viewurl = "/#/display/" + ds['10'].toLowerCase() + "?trn=" + ds['1']
fukai committed
341
        window.open(viewurl, 'newwindow', 'height=1200,width=900,top=100,left=100,toolbar=no,resizable=no,menubar=no,location=no, status=no');
342 343 344
    },
    async handleSearch() {
        const that = this.root;
345 346 347 348 349 350
        // if (this.model.searchAllUsers) {
        //     that.executeRule("seajbh").then(res => {
        //         //TODO 处理数据逻辑
        //         that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
        //     })
        // } else {
liushikai committed
351 352 353 354 355
            // that.executeRule("searow").then(res => {
            //     //TODO 处理数据逻辑
            //     that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
            //     this.model.trncorco.trnstm = res.data.trncorco_trnstm;
            // })
356
        // }
357
        const res = await this.executeRule("searow")
liushikai committed
358 359 360 361 362 363 364 365 366
        that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
        this.model.trncorco.trnstm = res.data.trncorco_trnstm;
        if(res.data.trncorco_trnstm.rows.length == 0){
            this.$notify({
                title: '成功',
                message: '搜索完毕,无满足条件记录',
                type: 'success'
            });
            }
367
    },
368

369
    async handleReset() {
370 371
        this.model.bchcon = "";
        this.model.trncorco.ownref = "";
liuxin committed
372
        this.model.trncorco.relflg = "ALL";
373 374 375 376 377 378 379
        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;
380 381
    },

382

383

liuxin committed
384
}