|
@@ -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 {
|