Browse Source

提交按周填报

Lijy 1 year ago
parent
commit
7660f2cecc

+ 8 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/weeklyCustomization.vue

@@ -17,7 +17,7 @@
                     <el-table-column label="项目" width="220">
                         <template slot-scope="scope">
                             <el-select v-model="scope.row.projectId" size="small" placeholder="请选择项目" clearable
-                                @change="changeProject(scope.row.projectId, scope.$index)" :disabled="scope.row.state == 1 || scope.row.state == 0">
+                                @change="changeProject(scope.row.projectId, scope.$index)" :disabled="scope.row.state == 1 || scope.row.state == 0 || !scope.row.canFill">
                                 <el-option v-for="item in projectList" :key="item.id" :label="item.projectName"
                                     :value="item.id">
                                 </el-option>
@@ -28,7 +28,7 @@
                         <template slot-scope="scope">
                             <el-select v-model="scope.row.groupId" size="small" placeholder="请选择分类"
                                 @change="changeGroup(scope.row.groupId, scope.row.taskGroups, scope.$index)"
-                                :disabled="scope.row.state == 1 || scope.row.state == 0">
+                                :disabled="scope.row.state == 1 || scope.row.state == 0 || !scope.row.canFill">
                                 <el-option v-for="item in scope.row.taskGroups" :key="item.id" :label="item.name"
                                     :value="item.id">
                                 </el-option>
@@ -38,13 +38,13 @@
                     <el-table-column prop="content" label="工作内容" width="300">
                         <template slot-scope="scope">
                             <el-input size="small" type="textarea" :rows="1" v-model="scope.row.content"
-                                :disabled="scope.row.state == 1 || scope.row.state == 0"></el-input>
+                                :disabled="scope.row.state == 1 || scope.row.state == 0 || !scope.row.canFill"></el-input>
                         </template>
                     </el-table-column>
                     <el-table-column prop="workingTime" label="时间(小时)" width="160">
                         <template slot-scope="scope">
                             <el-input-number size="small" v-model="scope.row.workingTime" :min="0" :max="12" :step="0.5"
-                                :disabled="scope.row.state == 1 || scope.row.state == 0"></el-input-number>
+                                :disabled="scope.row.state == 1 || scope.row.state == 0 || !scope.row.canFill"></el-input-number>
                         </template>
                     </el-table-column>
                     <el-table-column prop="projectAuditorId" label="审批人" width="160">
@@ -63,7 +63,7 @@
                                 <el-tag v-if="scope.row.state == 0" type="warning">待审</el-tag>
                                 <el-tag v-if="scope.row.state == 1" type="success">通过</el-tag>
                                 <el-tag v-if="scope.row.state == 2" type="danger">拒绝</el-tag>
-                                <span v-if="scope.row.state != 1">
+                                <span v-if="scope.row.state != 1 && scope.row.canFill">
                                     <el-link type="primary" :underline="false" class="el-icon-circle-plus-outline"
                                         @click="insertRow(scope.$index)"></el-link>
                                     <el-link type="primary" :underline="false" class="el-icon-delete"
@@ -254,12 +254,13 @@ export default {
             let { data } = await this.getData('/report/getWeeklyFillReportData', { targetDate: this.nowTime })
             const { dateList, projectList, sumTimeList, cardTimeList } = data;
             const weekTableData = dateList.flatMap(date => {
-                const { weekDayTxt, date: dateTime, reportList } = date;
+                const { weekDayTxt, date: dateTime, reportList, canFill } = date;
                 const reports = reportList.map(report => ({ ...report, weekDayTxt, dateTime }));
-                return reports.length > 0 ? reports : [{ weekDayTxt, dateTime }];
+                return reports.length > 0 ? reports : [{ weekDayTxt, dateTime, canFill }];
             });
 
             this.weekTableData = weekTableData;
+            console.log(weekTableData, '<========== weekTableData')
         },
         // 获取项目列表
         async getProjectList() {