|
@@ -213,21 +213,34 @@
|
|
|
</div>
|
|
|
<div style="width:770px;">
|
|
|
<el-form-item label="邮件截图:" prop="attendees" label-width="160px">
|
|
|
- <el-upload
|
|
|
- :file-list="uploadFiles2"
|
|
|
- ref="upload2"
|
|
|
- :on-success="upLoadSuccess2"
|
|
|
- :on-error="upLoadError2"
|
|
|
- :before-remove="beforeRemove2"
|
|
|
- :on-change="onChange2" :limit="1"
|
|
|
- :on-exceed="exceed2"
|
|
|
- :action="uploadURL"
|
|
|
- :headers="headers2"
|
|
|
+ <!-- <el-upload
|
|
|
+ ref="Emailscreenshotref"
|
|
|
+ :action="Emailscreenshoturl"
|
|
|
+ :data="Emailscreenshotdata"
|
|
|
+ :show-file-list="true"
|
|
|
:auto-upload="false"
|
|
|
- :on-preview="onPreview2">
|
|
|
+ :file-list="Emailscreenshot"
|
|
|
+ :on-change="Emailscreenshotchange"
|
|
|
+ :multiple="true"
|
|
|
+ name="files">
|
|
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
|
|
<el-button style="margin-left: 10px;" size="small" type="success"
|
|
|
- @click="submitUpload2">上传</el-button>
|
|
|
+ @click="UploadEmailscreenshot">上传</el-button>
|
|
|
+ </el-upload> -->
|
|
|
+ <el-upload
|
|
|
+ accept="image/jpeg,image/png"
|
|
|
+ class="pop-upload"
|
|
|
+ ref="upload"
|
|
|
+ action=""
|
|
|
+ :file-list="fileList"
|
|
|
+ :auto-upload="false"
|
|
|
+ :multiple="true"
|
|
|
+ :on-change="handleChange"
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ name="files"
|
|
|
+ >
|
|
|
+ <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
|
|
+ <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
@@ -277,7 +290,7 @@
|
|
|
<el-form-item>
|
|
|
<div style="text-align: right;">
|
|
|
<el-button type="primary" @click="addBtn">保存</el-button>
|
|
|
- <el-button type="primary">确认</el-button>
|
|
|
+ <el-button v-if="btnPermissions" type="primary">确认</el-button>
|
|
|
<el-button @click="returnbtn">取消</el-button>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
@@ -403,6 +416,16 @@ export default {
|
|
|
uploadFiles1: [],
|
|
|
uploadFiles2: [],
|
|
|
uploadFiles3: [],
|
|
|
+ Emailscreenshot:[],
|
|
|
+ Emailscreenshoturl:'http://132.232.92.186:8888/api/Resource/OfficialActivitiesUploadFiles',
|
|
|
+ Emailscreenshotdata:{
|
|
|
+ id:0,
|
|
|
+ diId:0,
|
|
|
+ currUserId:0,
|
|
|
+ },
|
|
|
+ Emailscreenshotheaders:{
|
|
|
+ Authorization:"Content-Type:multipart/form-data"
|
|
|
+ },
|
|
|
headers1: {
|
|
|
Authorization: JSON.parse(localStorage.getItem('userinif')).token,
|
|
|
Type: "1",
|
|
@@ -422,6 +445,9 @@ export default {
|
|
|
CreateUserId: 0,
|
|
|
},
|
|
|
yqfarr:[],
|
|
|
+ gwcfPermissions:[],
|
|
|
+ btnPermissions:false,
|
|
|
+ fileList:[],
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -489,6 +515,14 @@ export default {
|
|
|
// that.$message.error("网络错误,请稍后重试");
|
|
|
});
|
|
|
},
|
|
|
+ //UploadEmailscreenshot
|
|
|
+ UploadEmailscreenshot(){
|
|
|
+ console.log(file, fileList);
|
|
|
+ this.Emailscreenshotdata.diId=this.DiId;
|
|
|
+ this.Emailscreenshotdata.currUserId=this.userId;
|
|
|
+ this.submitUpload()
|
|
|
+ },
|
|
|
+
|
|
|
//获取邀请方
|
|
|
QuerySetData(){
|
|
|
var that = this;
|
|
@@ -511,6 +545,9 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ Emailscreenshotchange(file, fileList){
|
|
|
+ console.log(file, fileList);
|
|
|
+ },
|
|
|
//获取公务请示范例提示
|
|
|
PostOfficialActivitiesReqReqSampleTips(){
|
|
|
var that = this;
|
|
@@ -821,6 +858,7 @@ export default {
|
|
|
a.remove();
|
|
|
//window.location.href = "http://132.232.92.186:24/Office/GrpFile/商邀相关文件/" + file.name
|
|
|
},
|
|
|
+
|
|
|
//返回
|
|
|
returnbtn(){
|
|
|
this.$router.push({
|
|
@@ -829,16 +867,69 @@ export default {
|
|
|
DiId: this.DiId,
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用,function(file, fileList)
|
|
|
+ handleChange(file, fileList) {
|
|
|
+ this.fileList = fileList
|
|
|
+ },
|
|
|
+ // 删除文件之前的钩子,参数为上传的文件和文件列表,若返回 false 或者返回 Promise 且被 reject,则停止删除。function(file, fileList)
|
|
|
+ handleRemove(file, fileList) {
|
|
|
+ this.fileList = fileList
|
|
|
+ },
|
|
|
+ //上传服务器
|
|
|
+ submitUpload() {
|
|
|
+ console.log(this.id);
|
|
|
+ this.Emailscreenshotdata.diId=this.DiId;
|
|
|
+ this.Emailscreenshotdata.currUserId=this.userId;
|
|
|
+ //判断是否有文件再上传
|
|
|
+ if (this.fileList.length === 0) {
|
|
|
+ return this.$message.warning('请选取文件后再上传');
|
|
|
+ }
|
|
|
+ // 下面的代码将创建一个空的FormData对象:
|
|
|
+ const formData = new FormData()
|
|
|
+ // 你可以使用FormData.append来添加键/值对到表单里面;
|
|
|
+ this.fileList.forEach((file) => {
|
|
|
+ formData.append('files', file.raw);
|
|
|
+ })
|
|
|
+ formData.append('id', this.Emailscreenshotdata.id);
|
|
|
+ formData.append('diId', this.Emailscreenshotdata.diId);
|
|
|
+ formData.append('currUserId', this.Emailscreenshotdata.currUserId);
|
|
|
+
|
|
|
+ // var that = this;
|
|
|
+ // var url = "/api/Resource/OfficialActivitiesUploadFiles"
|
|
|
+ // this.$axios({
|
|
|
+ // method: 'post',
|
|
|
+ // url: url,
|
|
|
+ // headers: {
|
|
|
+ // Authorization: 'Bearer ' + that.token
|
|
|
+ // },
|
|
|
+ // data:formData
|
|
|
+ // }).then(function (res) {
|
|
|
+ // if (res.data.code == 200) {
|
|
|
+ // that.$message.success(res.data.msg);
|
|
|
+ // that.fileList = []
|
|
|
+ // } else {
|
|
|
+ // that.$message.error(res.data.msg);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
|
|
|
|
this.token = JSON.parse(localStorage.getItem('userinif')).token;
|
|
|
- this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
|
|
|
- this.QuerySetData();
|
|
|
- this.id = this.$route.query.id
|
|
|
+ this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
|
|
|
+ this.gwcfPermissions=JSON.parse(localStorage.getItem('Permissions'));
|
|
|
this.DiId = parseInt(this.$route.query.DiId)
|
|
|
+ console.log(this.gwcfPermissions);
|
|
|
+ for(let k=0;k<this.gwcfPermissions.length;k++){
|
|
|
+ if(this.gwcfPermissions[k].funid==12){
|
|
|
+ this.btnPermissions=true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.QuerySetData();
|
|
|
+ this.id = this.$route.query.id
|
|
|
this.headers1.DiId = this.DiId
|
|
|
this.headers1.CreateUserId = this.userId
|
|
|
|