|
@@ -78,7 +78,25 @@
|
|
</el-table>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
<div class="weeklySummary">
|
|
<div class="weeklySummary">
|
|
- <div class="weekly" v-if="user.companyId == wuqiId">周报:</div>
|
|
|
|
|
|
+ <div class="weekly" v-if="user.companyId == wuqiId"><span style="font: size 14px;">周报</span>
|
|
|
|
+ <br/>
|
|
|
|
+ <!-- <el-upload ref="upload" action="#" :http-request="uploadFile" :file-list="fileList" :show-file-list="true" :limit="5" multiple >
|
|
|
|
+ <el-link type="primary" :underline="false" style="margin-left:10px;"><i class="iconfont firerock-iconshangchuan"></i><span style="margin-left:5px;">{{ $t('attachUpload') }}</span></el-link>
|
|
|
|
+ </el-upload> -->
|
|
|
|
+ <el-upload
|
|
|
|
+ class="upload-demo"
|
|
|
|
+ :on-preview="handlePreview"
|
|
|
|
+ :on-remove="handleRemove"
|
|
|
|
+ :before-remove="beforeRemove"
|
|
|
|
+ :http-request="uploadFile"
|
|
|
|
+ multiple
|
|
|
|
+ :limit="5"
|
|
|
|
+ :on-exceed="handleExceed"
|
|
|
|
+ :file-list="fileList">
|
|
|
|
+ <el-button size="small" type="primary" :loading="upLoading">上传附件</el-button>
|
|
|
|
+ <div slot="tip" class="el-upload__tip">附件大小不超过10M</div>
|
|
|
|
+ </el-upload>
|
|
|
|
+ </div>
|
|
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 6}" maxlength="1000" show-word-limit
|
|
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 6}" maxlength="1000" show-word-limit
|
|
:placeholder="$t('qingShuRuZhouZongJie')"
|
|
:placeholder="$t('qingShuRuZhouZongJie')"
|
|
v-model="summaryContent" style="flex: 1;">
|
|
v-model="summaryContent" style="flex: 1;">
|
|
@@ -108,6 +126,9 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ serverFileList:[],
|
|
|
|
+ upLoading: false,
|
|
|
|
+ fileList:[],
|
|
summaryContent: null,
|
|
summaryContent: null,
|
|
weekTableData: [],
|
|
weekTableData: [],
|
|
projectList: [],
|
|
projectList: [],
|
|
@@ -127,10 +148,70 @@ export default {
|
|
this.getProjectList()
|
|
this.getProjectList()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ handleRemove(file, fileList) {
|
|
|
|
+ console.log(file, fileList);
|
|
|
|
+ console.log('删除的文件名=='+file.name);
|
|
|
|
+ console.log('服务器文件数组=='+this.serverFileList);
|
|
|
|
+ for (var i=0;i<this.serverFileList.length; i++) {
|
|
|
|
+ if (this.serverFileList[i].originName == file.name) {
|
|
|
|
+ this.serverFileList.splice(i,1);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handlePreview(file) {
|
|
|
|
+ console.log(file);
|
|
|
|
+ },
|
|
|
|
+ handleExceed(files, fileList) {
|
|
|
|
+ this.$message.warning(`最多上传5个文件`);
|
|
|
|
+ },
|
|
|
|
+ beforeRemove(file, fileList) {
|
|
|
|
+ return this.$confirm(`确定移除 ${ file.name }?`);
|
|
|
|
+ },
|
|
|
|
+ //上传
|
|
|
|
+ uploadFile(params) {
|
|
|
|
+ this.upLoading = true;
|
|
|
|
+ var fileObj = params.file;
|
|
|
|
+ var form = new FormData();
|
|
|
|
+ form.append("multipartFile", fileObj);
|
|
|
|
+ this.http.uploadFile('/common/uploadFile', form , res => {
|
|
|
|
+ this.upLoading = false;
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: this.$t('uploadedsuccessfully'),
|
|
|
|
+ type: 'success'
|
|
|
|
+ });
|
|
|
|
+ this.serverFileList.push({'originName':fileObj.name,'serverName':res.data});
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: 'error'
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ console.log(this.fileList);
|
|
|
|
+ }, error => {
|
|
|
|
+ this.upLoading = false;
|
|
|
|
+ this.$message({
|
|
|
|
+ message: error,
|
|
|
|
+ type: 'error'
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //下载
|
|
|
|
+ dowloadFile(row) {
|
|
|
|
+ this.http.post(this.port.project.dowloadFile, {
|
|
|
|
+ id: row.id
|
|
|
|
+ } , res => {
|
|
|
|
+ this.getOperList();
|
|
|
|
+ }, error => {
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 提交与暂存
|
|
// 提交与暂存
|
|
submitWeekData(draft) { // draft 暂存(1)提交(0)
|
|
submitWeekData(draft) { // draft 暂存(1)提交(0)
|
|
const newWeekData = cloneDeep(this.weekTableData)
|
|
const newWeekData = cloneDeep(this.weekTableData)
|
|
-
|
|
|
|
|
|
+ console.log('总文件数=='+this.serverFileList.length);
|
|
|
|
+ console.log(this.serverFileList);
|
|
let strArr = this.judgmentData(newWeekData)
|
|
let strArr = this.judgmentData(newWeekData)
|
|
const { allday } = this.user.timeType // 系统设置的每日工作时间
|
|
const { allday } = this.user.timeType // 系统设置的每日工作时间
|
|
if (strArr.length > 0) {
|
|
if (strArr.length > 0) {
|
|
@@ -144,6 +225,9 @@ export default {
|
|
let formData = new FormData();
|
|
let formData = new FormData();
|
|
formData.append("draft", draft);
|
|
formData.append("draft", draft);
|
|
formData.append('summary', this.summaryContent);
|
|
formData.append('summary', this.summaryContent);
|
|
|
|
+ if (this.serverFileList.length > 0) {
|
|
|
|
+ formData.append('weeklyAttachment', JSON.stringify(this.serverFileList));
|
|
|
|
+ }
|
|
let fixation = {
|
|
let fixation = {
|
|
id: -1,
|
|
id: -1,
|
|
projectId: '',
|
|
projectId: '',
|
|
@@ -287,6 +371,14 @@ export default {
|
|
let { data } = await this.getData('/report/getWeeklyFillReportData', { targetDate: this.nowTime })
|
|
let { data } = await this.getData('/report/getWeeklyFillReportData', { targetDate: this.nowTime })
|
|
console.log(JSON.parse(JSON.stringify(data)), '<===== 处理之前的')
|
|
console.log(JSON.parse(JSON.stringify(data)), '<===== 处理之前的')
|
|
this.summaryContent = data.summary;
|
|
this.summaryContent = data.summary;
|
|
|
|
+ this.serverFileList = data.weeklyAttachment?JSON.parse(data.weeklyAttachment):[];
|
|
|
|
+ if (this.serverFileList) {
|
|
|
|
+ for (var i=0;i<this.serverFileList.length; i++) {
|
|
|
|
+ var item = this.serverFileList[i];
|
|
|
|
+ this.fileList.push({name:item.originName, url:this.serverFileList[i].serverName});
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
data.dateList.forEach(dateItem => {
|
|
data.dateList.forEach(dateItem => {
|
|
const reportList = dateItem.reportList;
|
|
const reportList = dateItem.reportList;
|
|
reportList.forEach(report => {
|
|
reportList.forEach(report => {
|