|
@@ -36,11 +36,11 @@
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="content" :label="$t('gongZuoNeiRong')" width="300">
|
|
|
+ <el-table-column prop="content" :label="user.companyId == wuqiId ? '日报' : $t('gongZuoNeiRong')" width="300">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input size="small" type="textarea" :rows="2" v-model="scope.row.content"
|
|
|
+ <el-input size="small" type="textarea" :rows="2" v-model.trim="scope.row.content"
|
|
|
:disabled="scope.row.state == 1 || scope.row.state == 0 || !scope.row.canFill"
|
|
|
- resize="none"></el-input>
|
|
|
+ resize="none" :maxlength="user.companyId == wuqiId && 30" :show-word-limit="user.companyId == wuqiId" :placeholder="user.companyId == wuqiId ? '所在项目负责哪一模块(可重复填写),无需涉及技术细节。' : '' "></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="workingTime" :label="$t('shiJianXiaoShi')" width="160">
|
|
@@ -77,10 +77,29 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
- <div>
|
|
|
+ <div class="weeklySummary">
|
|
|
+ <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
|
|
|
- :placeholder="$t('qingShuRuZhouZongJie')"
|
|
|
- v-model="summaryContent">
|
|
|
+ :placeholder="user.companyId == wuqiId ? '本周主要工作回顾、遗留事宜的初步处理方案和预计完成时间、下周工作的计划,尽可能详细。' : $t('qingShuRuZhouZongJie')"
|
|
|
+ v-model="summaryContent" style="flex: 1;">
|
|
|
</el-input>
|
|
|
</div>
|
|
|
<div class="weeklyCustomization_btn">
|
|
@@ -107,6 +126,9 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ serverFileList:[],
|
|
|
+ upLoading: false,
|
|
|
+ fileList:[],
|
|
|
summaryContent: null,
|
|
|
weekTableData: [],
|
|
|
projectList: [],
|
|
@@ -114,6 +136,7 @@ export default {
|
|
|
submitLoading: false,
|
|
|
permissions: JSON.parse(sessionStorage.getItem("permissions")),
|
|
|
user: JSON.parse(sessionStorage.getItem("user")),
|
|
|
+ wuqiId: '1071'
|
|
|
}
|
|
|
},
|
|
|
computed: {},
|
|
@@ -125,10 +148,70 @@ export default {
|
|
|
this.getProjectList()
|
|
|
},
|
|
|
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)
|
|
|
const newWeekData = cloneDeep(this.weekTableData)
|
|
|
-
|
|
|
+ console.log('总文件数=='+this.serverFileList.length);
|
|
|
+ console.log(this.serverFileList);
|
|
|
let strArr = this.judgmentData(newWeekData)
|
|
|
const { allday } = this.user.timeType // 系统设置的每日工作时间
|
|
|
if (strArr.length > 0) {
|
|
@@ -142,6 +225,9 @@ export default {
|
|
|
let formData = new FormData();
|
|
|
formData.append("draft", draft);
|
|
|
formData.append('summary', this.summaryContent);
|
|
|
+ if (this.serverFileList.length > 0) {
|
|
|
+ formData.append('weeklyAttachment', JSON.stringify(this.serverFileList));
|
|
|
+ }
|
|
|
let fixation = {
|
|
|
id: -1,
|
|
|
projectId: '',
|
|
@@ -175,13 +261,33 @@ export default {
|
|
|
groupId: data.groupId,
|
|
|
id: data.id || -1,
|
|
|
}));
|
|
|
-
|
|
|
+ let flag = false
|
|
|
arr.forEach(item => {
|
|
|
+ if(item.projectId && !item.content && this.user.companyId == this.wuqiId) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: `${item.createDate} 日报请填写完整`,
|
|
|
+ })
|
|
|
+ flag = true
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ flag = false
|
|
|
+ }
|
|
|
Object.entries(item).forEach(([key, value]) => {
|
|
|
formData.append(key, value);
|
|
|
});
|
|
|
});
|
|
|
-
|
|
|
+ const hasProjectIdValue = arr.some(obj => obj.projectId && obj.projectId !== '');
|
|
|
+ if(hasProjectIdValue && !this.summaryContent && this.user.companyId == this.wuqiId) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: `请填写周报`,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(flag) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.submitLoading = true
|
|
|
this.http.uploadFile(this.port.report.editPort, formData,
|
|
|
res => {
|
|
@@ -265,6 +371,14 @@ export default {
|
|
|
let { data } = await this.getData('/report/getWeeklyFillReportData', { targetDate: this.nowTime })
|
|
|
console.log(JSON.parse(JSON.stringify(data)), '<===== 处理之前的')
|
|
|
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 => {
|
|
|
const reportList = dateItem.reportList;
|
|
|
reportList.forEach(report => {
|
|
@@ -406,6 +520,21 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
<style scoped lang='scss'>
|
|
|
+.weeklySummary {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ border: 1px solid #EBEEF5;
|
|
|
+ border-top: 0px;
|
|
|
+ padding: 10px 20px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ .weekly {
|
|
|
+ padding: 0 20px;
|
|
|
+ font-size: 20px;
|
|
|
+ color: #909399;
|
|
|
+ }
|
|
|
+}
|
|
|
.flexColumn {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|