Event.js 10.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;
liuxin committed
6
            that.executeRule("searow").then(res => {
liuxin committed
7
                //TODO 处理数据逻辑
liuxin committed
8
                that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
潘际乾 committed
9
                this.model.trncorco.trnstm = res.data.trncorco_trnstm;
liuxin committed
10
            })
liuxin committed
11
    },
12 13
    async onSeajbh() {
        const that = this.root;
liuxin committed
14
            that.executeRule("seajbh").then(res => {
liuxin committed
15
                //TODO 处理数据逻辑
liuxin committed
16 17
                that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
            })
liuxin committed
18
    },
19 20
    async onSeactr() {
        let rtnmsg = await this.executeRule("seactr")
潘际乾 committed
21
            if (rtnmsg.respCode == SUCCESS) {
liuxin committed
22
                //TODO 处理数据逻辑
liuxin committed
23

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

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

liuxin committed
44 45 46 47 48
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
    },
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")
潘际乾 committed
61
            if (rtnmsg.respCode == SUCCESS) {
liuxin committed
62
                //TODO 处理数据逻辑
liuxin committed
63

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

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

liuxin committed
84 85 86 87 88
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
    },
89
    async onRelrow() {
潘际乾 committed
90
        const that = this
潘际乾 committed
91 92
        that.model.trncorco.selinr.empty = false
        that.model.trncorco.selinr.rows = that.multipleSelection.map(idx => that.model.trncorco.trnstm.rows[idx])
93
        let rtnmsg = await this.executeRule("relrow")
潘际乾 committed
94
        if (rtnmsg.respCode == SUCCESS) {
95
            //TODO 处理数据逻辑
wangguangchao committed
96

97 98 99 100 101 102
            this.$message({
                type: 'success',
                message: 'Release成功!'
            });
            await this.sleep(2000);
            this.$router.go(0);
wangguangchao committed
103
                
104 105 106 107 108
            
        }
        else {
            that.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
liuxin committed
109
    },
wangguangchao committed
110 111 112 113 114 115 116
    sleep (ms) {
        return new Promise((resolve, reject) => {
          setTimeout(() => {
            resolve()
          }, ms)
        })
      },
117 118
      async onPrinte() {
        let rtnmsg = await this.executeRule("printe")
潘际乾 committed
119
            if (rtnmsg.respCode == SUCCESS) {
liuxin committed
120
                //TODO 处理数据逻辑
liuxin committed
121

liuxin committed
122 123 124 125 126
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
    },
127 128
    async onReprow() {
        let rtnmsg = await this.executeRule("reprow")
潘际乾 committed
129
            if (rtnmsg.respCode == SUCCESS) {
liuxin committed
130
                //TODO 处理数据逻辑
liuxin committed
131

liuxin committed
132 133 134 135 136
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
    },
137
    async onRejrow() {
denyu committed
138 139 140
        console.log(this.getSelectedData())

        this.model.trncorco.selinr['rows'] = this.getSelectedData();
141
            let rtnmsg = await Api.post("trnrel/rejrow", this.wrapper())
潘际乾 committed
142
            if (rtnmsg.respCode == SUCCESS) {
liuxin committed
143
                //TODO 处理数据逻辑
144 145
                // var cacheFileName = rtnmsg.data.cacheFileName;
                // let rejrowRtnmsg = await Api.post("trncor/init", {params:{"cacheFileName":cacheFileName}})
潘际乾 committed
146
                // if(rejrowRtnmsg.respCode == SUCCESS){
147 148 149 150 151 152 153 154 155 156 157 158 159 160
                //     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);
liuxin committed
161

liuxin committed
162 163 164 165 166
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
    },
167 168
    async onRelcor() {
        let rtnmsg = await this.executeRule("relcor")
潘际乾 committed
169
            if (rtnmsg.respCode == SUCCESS) {
liuxin committed
170
                //TODO 处理数据逻辑
liuxin committed
171

liuxin committed
172 173 174 175 176
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
    },
177 178
    async onExi() {
        let rtnmsg = await this.executeRule("exi")
潘际乾 committed
179
            if (rtnmsg.respCode == SUCCESS) {
liuxin committed
180
                //TODO 处理数据逻辑
liuxin committed
181

liuxin committed
182 183 184 185 186
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
    },
潘际乾 committed
187
    
188 189
    async onRecpanDet() {
        let rtnmsg = await this.executeRule("recpan_det")
潘际乾 committed
190
            if (rtnmsg.respCode == SUCCESS) {
liuxin committed
191
                //TODO 处理数据逻辑
liuxin committed
192

liuxin committed
193 194 195 196 197
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
    },
198 199
    async onSyswrnButshw() {
        let rtnmsg = await this.executeRule("syswrn_butshw")
潘际乾 committed
200
            if (rtnmsg.respCode == SUCCESS) {
liuxin committed
201
                //TODO 处理数据逻辑
liuxin committed
202

liuxin committed
203 204 205 206 207
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
    },
208 209
    async onRecpanNotmap() {
        let rtnmsg = await this.executeRule("recpan_notmap")
潘际乾 committed
210
            if (rtnmsg.respCode == SUCCESS) {
liuxin committed
211
                //TODO 处理数据逻辑
liuxin committed
212

liuxin committed
213 214 215 216 217
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
    },
218 219
    async onRecpanButspt() {
        let rtnmsg = await this.executeRule("recpan_butspt")
潘际乾 committed
220
            if (rtnmsg.respCode == SUCCESS) {
liuxin committed
221
                //TODO 处理数据逻辑
liuxin committed
222

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

liuxin committed
233 234 235 236 237
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
    },
238 239
    async onRecpanButord() {
        let rtnmsg = await this.executeRule("recpan_butord")
潘际乾 committed
240
            if (rtnmsg.respCode == SUCCESS) {
liuxin committed
241
                //TODO 处理数据逻辑
liuxin committed
242

liuxin committed
243 244 245 246 247
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
    },
248 249
    async  onImgmodImage() {
        let rtnmsg = await this.executeRule("imgmod_image")
潘际乾 committed
250
            if (rtnmsg.respCode == SUCCESS) {
liuxin committed
251
                //TODO 处理数据逻辑
liuxin committed
252

liuxin committed
253 254 255 256 257
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
    },
258 259
    async  onRecpanIncben() {
        let rtnmsg = await this.executeRule("recpan_incben")
潘际乾 committed
260
            if (rtnmsg.respCode == SUCCESS) {
liuxin committed
261
                //TODO 处理数据逻辑
liuxin committed
262

liuxin committed
263 264 265 266 267
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
    },
268 269
    async onInftxtButtxmsel() {
        let rtnmsg = await this.executeRule("inftxt_buttxmsel")
潘际乾 committed
270
            if (rtnmsg.respCode == SUCCESS) {
liuxin committed
271
                //TODO 处理数据逻辑
liuxin committed
272

liuxin committed
273 274 275 276 277 278
            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败!' });
            }
    },
    onSeainf() {
liuxin committed
279

denyu committed
280 281
    },
    display(index, row){
潘际乾 committed
282 283 284
        const d = this.stmData.data[index]
        const ds = d.split("\t")
        let viewurl ="/#/display/"+ds['10'].toLowerCase()+"?trn="+ds['1']
fukai committed
285
        window.open(viewurl, 'newwindow', 'height=1200,width=900,top=100,left=100,toolbar=no,resizable=no,menubar=no,location=no, status=no');
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
    },
    async handleSearch() {
        const that = this.root;
        if(this.model.searchAllUsers){
            that.executeRule("seajbh").then(res => {
                //TODO 处理数据逻辑
                that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
            })
        }else{
            that.executeRule("searow").then(res => {
                //TODO 处理数据逻辑
                that.$refs.inftrnps.stmData.data = res.data.trncorco_trnstm.rows;
                this.model.trncorco.trnstm = res.data.trncorco_trnstm;
            })
        }
    },
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316

    async handleReset(){
        this.model.bchcon = "";
        this.model.trncorco.ownref = "";
        this.model.trncorco.relflg = "Waiting";
        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;
    }

    
liuxin committed
317
}