|
@@ -320,65 +320,61 @@ export default {
|
|
|
|
|
|
//点击保存事件
|
|
|
addBtn() {
|
|
|
- debugger
|
|
|
-
|
|
|
const that = this;
|
|
|
that.OpInvitationOfficialActivityData.createUserId = that.userId
|
|
|
-
|
|
|
that.$refs.OpInvitationOfficialActivityData.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- debugger
|
|
|
- if (that.uploadFiles.length == 0 || that.uploadFiles[0].name == that.OpInvitationOfficialActivityData.sndFilePath) {
|
|
|
- var delegationStr = '';
|
|
|
- if(that.OpInvitationOfficialActivityData.delegation){
|
|
|
- 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',
|
|
|
- url: url,
|
|
|
- headers: {
|
|
|
- Authorization: 'Bearer ' + that.token
|
|
|
- },
|
|
|
- data: that.OpInvitationOfficialActivityData
|
|
|
- }).then(function (res) {
|
|
|
- debugger
|
|
|
- if (res.data.code == 200) {
|
|
|
- console.log(that.OpInvitationOfficialActivityData.delegation);
|
|
|
- var delList = that.OpInvitationOfficialActivityData.delegation.split(',')
|
|
|
- var delegaLOist = [];
|
|
|
- console.log(delList);
|
|
|
- if(delList){
|
|
|
- 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);
|
|
|
- } else {
|
|
|
- that.$message.error(res.data.msg);
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
+ console.log(that.uploadFiles.length);
|
|
|
+ console.log(that.uploadFiles);
|
|
|
+ if (that.uploadFiles.length != 0 && that.uploadFiles[0].name!= that.OpInvitationOfficialActivityData.sndFilePath) {
|
|
|
that.$refs.upload.submit();//上传文件到服务器
|
|
|
}
|
|
|
+ var delegationStr = '';
|
|
|
+ if(that.OpInvitationOfficialActivityData.delegation){
|
|
|
+ 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',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + that.token
|
|
|
+ },
|
|
|
+ data: that.OpInvitationOfficialActivityData
|
|
|
+ }).then(function (res) {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ console.log(that.OpInvitationOfficialActivityData.delegation);
|
|
|
+ var delList = that.OpInvitationOfficialActivityData.delegation.split(',')
|
|
|
+ var delegaLOist = [];
|
|
|
+ console.log(delList);
|
|
|
+ if(delList){
|
|
|
+ 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);
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.data.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
var delList = this.OpInvitationOfficialActivityData.delegation.split(',')
|
|
|
var delegaLOist = [];
|
|
|
- delList.forEach(function (item, index) {
|
|
|
+ delList.forEach(function (item, index) {
|
|
|
delegaLOist.push(
|
|
|
parseInt(item)
|
|
|
)
|
|
@@ -399,11 +395,9 @@ export default {
|
|
|
},
|
|
|
//文件上传成功时的钩子
|
|
|
upLoadSuccess(response, file, fileList) {
|
|
|
- debugger
|
|
|
if (response.code == 200) {
|
|
|
- debugger
|
|
|
console.log("上传成功");
|
|
|
- that.$refs.OpInvitationOfficialActivityData.validate((valid) => {
|
|
|
+ this.$refs.OpInvitationOfficialActivityData.validate((valid) => {
|
|
|
if (valid) {
|
|
|
const that = this;
|
|
|
that.OpInvitationOfficialActivityData.filePath = that.OldFile;
|