Event.js 13.6 KB
Newer Older
liuxin committed
1 2
import Api from "~/service/Api"
import Utils from "~/utils/index"
liuxin committed
3
export default {
liuxin committed
4 5 6 7
    onSeaown() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
liuxin committed
8 9
            const that = this.$parent.$parent.$parent.$parent;
            that.executeRule("searow").then(res => {
liuxin committed
10
                //TODO 处理数据逻辑
liuxin committed
11
                that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
潘际乾 committed
12
                this.model.trncorco.trnstm = res.data.trncorco_trnstm;
liuxin committed
13
            })
14
            // let rtnmsg = await Api.post("trnrel/executeRule/searow", Utils.getRequestDataFn.call(this))
liuxin committed
15 16 17 18 19 20 21
            // if (rtnmsg.respCode == "AAAAAA") {
            //     //TODO 处理数据逻辑
            //     this.stmData.data = rtnmsg.data.trncorco_trnstm.rows;
            // }
            // else {
            //     this.$notify.error({ title: '错误', message: '服务请求失败!' });
            // }
liuxin committed
22 23 24 25 26 27
        })
    },
    onSeajbh() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
liuxin committed
28 29
            const that = this.$parent.$parent.$parent.$parent;
            that.executeRule("seajbh").then(res => {
liuxin committed
30
                //TODO 处理数据逻辑
liuxin committed
31 32
                that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
            })
liuxin committed
33 34 35 36 37 38
        })
    },
    onSeactr() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
39
            let rtnmsg = await Api.post("trnrel/seactr", Utils.getRequestDataFn.call(this))
liuxin committed
40 41
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
42

liuxin committed
43 44 45 46 47 48 49 50 51 52
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onSearow() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
wangguangchao committed
53

54
            let rtnmsg = await Api.post("trnrel/searow", Utils.getRequestDataFn.call(this))
liuxin committed
55 56
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
57

liuxin committed
58 59 60 61 62 63 64 65 66 67
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onDsp() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
68
            let rtnmsg = await Api.post("trnrel/dsp", Utils.getRequestDataFn.call(this))
liuxin committed
69 70
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
71

liuxin committed
72 73 74 75 76 77 78 79 80 81
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onImgmodNewimg() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
82
            let rtnmsg = await Api.post("trnrel/imgmod_newimg", Utils.getRequestDataFn.call(this))
liuxin committed
83 84
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
85

liuxin committed
86 87 88 89 90 91 92 93 94 95
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onImgmodNewhisimg() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
96
            let rtnmsg = await Api.post("trnrel/imgmod_newhisimg", Utils.getRequestDataFn.call(this))
liuxin committed
97 98
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
99

liuxin committed
100 101 102 103 104 105 106 107 108 109
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onDiaconButdia() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
110
            let rtnmsg = await Api.post("trnrel/diacon_butdia", Utils.getRequestDataFn.call(this))
liuxin committed
111 112
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
113

liuxin committed
114 115 116 117 118 119 120 121 122 123
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onImgmodHisimg() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
124
            let rtnmsg = await Api.post("trnrel/imgmod_hisimg", Utils.getRequestDataFn.call(this))
liuxin committed
125 126
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
127

liuxin committed
128 129 130 131 132 133 134
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onRelrow() {
潘际乾 committed
135 136
        const that = this
        that.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
liuxin committed
137 138
            if (!valid)
                return;
潘际乾 committed
139 140 141
            that.model.trncorco.selinr = {
                "rows": that.multipleSelection.map(idx => that.model.trncorco.trnstm.rows[idx])
            }
142
            const data = Utils.getRequestDataFn.call(this)
潘际乾 committed
143
            let rtnmsg = await Api.post("/trnrel/executeRule/relrow", data)
liuxin committed
144 145
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
wangguangchao committed
146 147 148 149 150

                this.$message({
                    type: 'success',
                    message: 'Release成功!'
                });
wangguangchao committed
151 152 153 154
                await this.sleep(2000);
                this.$router.go(0);
                    
                
liuxin committed
155 156
            }
            else {
潘际乾 committed
157
                that.$notify.error({ title: '错误', message: '服务请求失败!' });
liuxin committed
158 159 160
            }
        })
    },
wangguangchao committed
161 162 163 164 165 166 167
    sleep (ms) {
        return new Promise((resolve, reject) => {
          setTimeout(() => {
            resolve()
          }, ms)
        })
      },
liuxin committed
168 169 170 171
    onPrinte() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
172
            let rtnmsg = await Api.post("trnrel/printe", Utils.getRequestDataFn.call(this))
liuxin committed
173 174
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
175

liuxin committed
176 177 178 179 180 181 182 183 184 185
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onReprow() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
186
            let rtnmsg = await Api.post("trnrel/reprow", Utils.getRequestDataFn.call(this))
liuxin committed
187 188
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
189

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

        this.model.trncorco.selinr['rows'] = this.getSelectedData();
liuxin committed
201
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
denyu committed
202 203
            // if (!valid)
            //     return;
204
            let rtnmsg = await Api.post("trnrel/rejrow", Utils.getRequestDataFn.call(this))
liuxin committed
205 206
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
wangguangchao committed
207
                var cacheFileName = rtnmsg.data.cacheFileName;
wangguangchao committed
208 209 210 211 212 213 214 215 216
                let rejrowRtnmsg = await Api.post("trncor/init", {params:{"cacheFileName":cacheFileName}})
                if(rejrowRtnmsg.respCode == "AAAAAA"){
                    this.$message({
                        type: 'success',
                        message: 'Reject成功!'
                    });
                    await this.sleep(2000);
                    this.$router.go(0);
                }
liuxin committed
217

liuxin committed
218 219 220 221 222 223 224 225 226 227
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onRelcor() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
228
            let rtnmsg = await Api.post("trnrel/relcor", Utils.getRequestDataFn.call(this))
liuxin committed
229 230
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
231

liuxin committed
232 233 234 235 236 237 238 239 240 241
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onExi() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
242
            let rtnmsg = await Api.post("trnrel/exi", Utils.getRequestDataFn.call(this))
liuxin committed
243 244
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
245

liuxin committed
246 247 248 249 250 251
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
潘际乾 committed
252
    
liuxin committed
253 254 255 256
    onRecpanDet() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
257
            let rtnmsg = await Api.post("trnrel/recpan_det", Utils.getRequestDataFn.call(this))
liuxin committed
258 259
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
260

liuxin committed
261 262 263 264 265 266 267 268 269 270
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onSyswrnButshw() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
271
            let rtnmsg = await Api.post("trnrel/syswrn_butshw", Utils.getRequestDataFn.call(this))
liuxin committed
272 273
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
274

liuxin committed
275 276 277 278 279 280 281 282 283 284
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onRecpanNotmap() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
285
            let rtnmsg = await Api.post("trnrel/recpan_notmap", Utils.getRequestDataFn.call(this))
liuxin committed
286 287
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
288

liuxin committed
289 290 291 292 293 294 295 296 297 298
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onRecpanButspt() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
299
            let rtnmsg = await Api.post("trnrel/recpan_butspt", Utils.getRequestDataFn.call(this))
liuxin committed
300 301
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
302

liuxin committed
303 304 305 306 307 308 309 310 311 312
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onRecpanInc() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
313
            let rtnmsg = await Api.post("trnrel/recpan_inc", Utils.getRequestDataFn.call(this))
liuxin committed
314 315
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
316

liuxin committed
317 318 319 320 321 322 323 324 325 326
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onRecpanButord() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
327
            let rtnmsg = await Api.post("trnrel/recpan_butord", Utils.getRequestDataFn.call(this))
liuxin committed
328 329
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
330

liuxin committed
331 332 333 334 335 336 337 338 339 340
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onImgmodImage() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
341
            let rtnmsg = await Api.post("trnrel/imgmod_image", Utils.getRequestDataFn.call(this))
liuxin committed
342 343
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
344

liuxin committed
345 346 347 348 349 350 351 352 353 354
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onRecpanIncben() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
355
            let rtnmsg = await Api.post("trnrel/recpan_incben", Utils.getRequestDataFn.call(this))
liuxin committed
356 357
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
358

liuxin committed
359 360 361 362 363 364 365 366 367 368
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
        })
    },
    onInftxtButtxmsel() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
369
            let rtnmsg = await Api.post("trnrel/inftxt_buttxmsel", Utils.getRequestDataFn.call(this))
liuxin committed
370 371
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑
liuxin committed
372

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

denyu committed
381 382
    },
    display(index, row){
fukai committed
383 384
        let viewurl ="/#/display/"+row['10'].toLowerCase()+"?trn="+row['1']
        window.open(viewurl, 'newwindow', 'height=1200,width=900,top=100,left=100,toolbar=no,resizable=no,menubar=no,location=no, status=no');
liuxin committed
385
    }
liuxin committed
386
}