Quellcode durchsuchen

多选框修改

wangh vor 1 Jahr
Ursprung
Commit
f2825fef74

+ 25 - 0
src/components/OP/OpAirTicketRes.vue

@@ -599,10 +599,20 @@ export default {
         addBtn() {
 
             if (this.IsAuditGM == 1) {
+                var ss = this.airTicketResOpData.clientName.split(',')
+                this.airTicketResOpData.clientName = [];
+                ss.forEach(function (item) {
+                    that.airTicketResOpData.clientName.push(parseInt(item))
+                });
                 this.$message.error('审核已通过,不可修改!');
             } else {
                 if (this.DiId == null && this.DiId == undefined && this.DiId == "") {
                     this.$message.error("请选择团组名称");
+                    var ss = this.airTicketResOpData.clientName.split(',')
+                    this.airTicketResOpData.clientName = [];
+                    ss.forEach(function (item) {
+                        that.airTicketResOpData.clientName.push(parseInt(item))
+                    });
                     return;
                 }
 
@@ -656,10 +666,20 @@ export default {
                                 type: 'success'
                             });
                             that.loading = true;
+                            var ss = that.airTicketResOpData.clientName.split(',')
+                            that.airTicketResOpData.clientName = [];
+                            ss.forEach(function (item) {
+                                that.airTicketResOpData.clientName.push(parseInt(item))
+                            });
                             setTimeout(() => {
                                 that.$router.push('/home/AirTicketRes')
                             }, 3000);
                         } else {
+                            var ss = that.airTicketResOpData.clientName.split(',')
+                            that.airTicketResOpData.clientName = [];
+                            ss.forEach(function (item) {
+                                that.airTicketResOpData.clientName.push(parseInt(item))
+                            });
                             that.$message.error(res.data.msg);
                         }
                     }).catch(function (error) {
@@ -667,6 +687,11 @@ export default {
                     })// 此时必填完成,做保存后的业务操作
 
                 }).catch(_ => {
+                    var ss = this.airTicketResOpData.clientName.split(',')
+                    this.airTicketResOpData.clientName = [];
+                    ss.forEach(function (item) {
+                        that.airTicketResOpData.clientName.push(parseInt(item))
+                    });
                     this.$message.error('请完善信息在保存!');
                     return false;
                 })

+ 61 - 29
src/components/Resource/OpInvitationOfficialActivityData.vue

@@ -319,15 +319,16 @@ export default {
 
             const that = this;
             that.OpInvitationOfficialActivityData.createUserId = that.userId
-            var delegationStr = '';
-            that.OpInvitationOfficialActivityData.delegation.forEach(function (item, index) {
-                delegationStr += item + ','
-            });
-            that.OpInvitationOfficialActivityData.delegation = delegationStr.substring(0, delegationStr.length - 1)
+
             that.$refs.OpInvitationOfficialActivityData.validate((valid) => {
                 if (valid) {
                     debugger
                     if (that.uploadFiles.length == 0 || that.uploadFiles[0].name == that.OpInvitationOfficialActivityData.sndFilePath) {
+                        var delegationStr = '';
+                        that.OpInvitationOfficialActivityData.delegation.forEach(function (item, index) {
+                            delegationStr += item + ','
+                        });
+                        that.OpInvitationOfficialActivityData.delegation = delegationStr.substring(0, delegationStr.length - 1)
                         var url = "/api/Resource/OpInvitationOfficialActivity"
                         that.$axios({
                             method: 'post',
@@ -339,11 +340,20 @@ export default {
                         }).then(function (res) {
                             debugger
                             if (res.data.code == 200) {
+                                var delList = that.OpInvitationOfficialActivityData.delegation.split(',')
+                                var delegaLOist = [];
+                                delList.forEach(function (item, index) {
+                                    delegaLOist.push(
+                                        parseInt(item)
+                                    )
+                                });
+                                that.OpInvitationOfficialActivityData.delegation = delegaLOist
                                 that.$message({
                                     message: res.data.msg,
                                     type: 'success'
                                 });
                                 that.loading = true;
+
                                 setTimeout(() => {
                                     that.$router.push('/home/InvitationOfficialActivityData')
                                 }, 3000);
@@ -353,9 +363,16 @@ export default {
                         })
                     } else {
                         that.$refs.upload.submit();//上传文件到服务器
-
                     }
                 } else {
+                    var delList = this.OpInvitationOfficialActivityData.delegation.split(',')
+                    var delegaLOist = [];
+                    delList.forEach(function (item, index) {
+                        delegaLOist.push(
+                            parseInt(item)
+                        )
+                    });
+                    this.OpInvitationOfficialActivityData.delegation = delegaLOist
                     this.$message.error('请完善信息在保存!');
                     return false;
                 }
@@ -375,30 +392,45 @@ export default {
             if (response.code == 200) {
                 debugger
                 console.log("上传成功");
-                const that = this;
-                that.OpInvitationOfficialActivityData.filePath = that.OldFile;
-                that.OpInvitationOfficialActivityData.sndFilePath = response.data;
-                that.OpInvitationOfficialActivityData.createUserId = that.userId
-                var url = "/api/Resource/OpInvitationOfficialActivity"
-                that.$axios({
-                    method: 'post',
-                    url: url,
-                    headers: {
-                        Authorization: 'Bearer ' + that.token
-                    },
-                    data: that.OpInvitationOfficialActivityData
-                }).then(function (res) {
-                    if (res.data.code == 200) {
-                        that.$message({
-                            message: res.data.msg,
-                            type: 'success'
-                        });
-                        that.loading = true;
-                        setTimeout(() => {
-                            that.$router.push('/home/InvitationOfficialActivityData')
-                        }, 3000);
+                that.$refs.OpInvitationOfficialActivityData.validate((valid) => {
+                    if (valid) {
+                        const that = this;
+                        that.OpInvitationOfficialActivityData.filePath = that.OldFile;
+                        that.OpInvitationOfficialActivityData.sndFilePath = response.data;
+                        that.OpInvitationOfficialActivityData.createUserId = that.userId
+                        var url = "/api/Resource/OpInvitationOfficialActivity"
+                        that.$axios({
+                            method: 'post',
+                            url: url,
+                            headers: {
+                                Authorization: 'Bearer ' + that.token
+                            },
+                            data: that.OpInvitationOfficialActivityData
+                        }).then(function (res) {
+                            if (res.data.code == 200) {
+                                that.$message({
+                                    message: res.data.msg,
+                                    type: 'success'
+                                });
+                                that.loading = true;
+                                setTimeout(() => {
+                                    that.$router.push('/home/InvitationOfficialActivityData')
+                                }, 3000);
+                            } else {
+                                that.$message.error(res.data.msg);
+                            }
+                        })
                     } else {
-                        that.$message.error(res.data.msg);
+                        var delList = this.OpInvitationOfficialActivityData.delegation.split(',')
+                        var delegaLOist = [];
+                        delList.forEach(function (item, index) {
+                            delegaLOist.push(
+                                parseInt(item)
+                            )
+                        });
+                        this.OpInvitationOfficialActivityData.delegation = delegaLOist
+                        this.$message.error('请完善信息在保存!');
+                        return false;
                     }
                 })
             } else {