Browse Source

提交相关代码

Lijy 6 months ago
parent
commit
56874cbfc3

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

@@ -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"></el-input>
                         </template>
                     </el-table-column>
                     <el-table-column prop="workingTime" :label="$t('shiJianXiaoShi')" width="160">
@@ -77,10 +77,11 @@
                     </el-table-column>
                 </el-table>
             </div>
-            <div>
+            <div class="weeklySummary">
+                <div class="weekly" v-if="user.companyId == wuqiId">周报:</div>
                 <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 6}" maxlength="1000" show-word-limit
                     :placeholder="$t('qingShuRuZhouZongJie')"
-                    v-model="summaryContent">
+                    v-model="summaryContent" style="flex: 1;">
                     </el-input>
             </div>
             <div class="weeklyCustomization_btn">
@@ -114,6 +115,7 @@ export default {
             submitLoading: false,
             permissions: JSON.parse(sessionStorage.getItem("permissions")),
             user: JSON.parse(sessionStorage.getItem("user")),
+            wuqiId: '1071'
         }
     },
     computed: {},
@@ -175,13 +177,25 @@ export default {
                     groupId: data.groupId,
                     id: data.id || -1,
                 }));
-
             arr.forEach(item => {
+                if(item.projectId && !item.content && this.user.companyId == this.wuqiId) {
+                    this.$message({
+                        type: 'warning',
+                        message: `${item.createDate} 日报请填写完整`,
+                    })
+                }
                 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
+            }
             this.submitLoading = true
             this.http.uploadFile(this.port.report.editPort, formData,
                 res => {
@@ -406,6 +420,17 @@ export default {
 }
 </script>
 <style scoped lang='scss'>
+.weeklySummary {
+    width: 100%;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    .weekly {
+        padding: 0 20px;
+        font-size: 20px;
+        color: #909399;
+    }
+}
 .flexColumn {
     display: flex;
     flex-direction: column;