Browse Source

提交代码

Lijy 4 tháng trước cách đây
mục cha
commit
26ebf19dd2

+ 98 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/financeComponents/incomeDetail.vue

@@ -9,6 +9,9 @@
           @change="retrieveDataAgain" :clearable="false" type="month" placeholder="选择月份" />
       </div>
       <div class="item-center">
+        <el-link type="primary" :underline="false" @click="notParticipatingInSharedProjects()">
+          不参与分摊项目设置
+        </el-link>
         <el-link type="primary" :underline="false" class="ml" @click="bonusDataExport">数据导出</el-link>
         <el-link type="primary" :underline="false" class="ml" @click="clickOnFundingData">数据上传</el-link>
         <el-link type="primary" :underline="false" class="ml" href="./upload/员工奖金模板.xlsx"
@@ -45,6 +48,29 @@
       </div>
     </div>
 
+    <el-dialog :title="`${notParticipatingInSharedProjectsTitle}月 不参与分摊项目设置`"
+        v-if="notParticipatingInSharedProjectsVisable" :visible.sync="notParticipatingInSharedProjectsVisable"
+        :close-on-click-modal="false" customClass="customWidth" width="1000px">
+        <el-form ref="form3">
+            <el-form-item :label="''">
+                <el-select v-model="notParticipatingInSharedProjectsValue" placeholder="请选择项目" filterable multiple
+                    :disabled="notParticipatingInSharedProjectDisabled" style="width: 100%;" clearable>
+                    <el-option v-for="item in projectAllList" :key="item.id" :label="item.projectName"
+                        :value="item.id">
+                    </el-option>
+                </el-select>
+            </el-form-item>
+            <el-form-item :label="''">
+                <el-link type="warning" :underline="false">*设置后请重新导入该月人员薪资</el-link>
+            </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+            <el-button type="primary" style="width:100%;" :loading="notParticipatingInSharedProjectsLoading"
+                @click="submitNotParticipatingInSharedProject()">确定</el-button>
+        </div>
+    </el-dialog>
+
+
     <!-- 资金数据导入 -->
     <el-dialog title="资金数据导入" v-if="fundsImportIntoVisable" :visible.sync="fundsImportIntoVisable"
       customClass="customWidth" width="500px">
@@ -122,15 +148,86 @@ export default {
         }
       },
       importTemplateData: null,
+      notParticipatingInSharedProjectsTitle: '',
+      notParticipatingInSharedProjectsVisable: false,
+      notParticipatingInSharedProjectsValue: '',
+      notParticipatingInSharedProjectDisabled: '',
+      notParticipatingInSharedProjectsLoading: false,
+      notParticipatingInSharedAllProject: false,
+      selectProjectBonusAllocation: [],
+      projectAllList: [],
       echartsData: [],
       myChart: null,
     };
   },
   mounted() {
-    this.retrieveDataAgain()
     this.scrollFunction()
+    this.getAllProjectList()
+    this.loadMonthData()
   },
   methods: {
+    loadMonthData() {
+      this.getSelectProjectBonusAllocation()
+      this.retrieveDataAgain()
+    },
+    submitNotParticipatingInSharedProject() {
+      this.notParticipatingInSharedProjectsLoading = true
+      this.http.post('/bonusExcludeProject/addOrUpdateProjects', {
+          projects: this.notParticipatingInSharedProjectsValue,
+          isAll: this.notParticipatingInSharedAllProject ? 1 : 0
+      }, res => {
+          this.notParticipatingInSharedProjectsLoading = false
+          if (res.code == 'ok') {
+              this.$message({
+                  message: '操作成功',
+                  type: 'success'
+              })
+              this.notParticipatingInSharedProjectsVisable = false
+              this.loadMonthData()
+              // this.getAllocateSelectedItems()
+          } else {
+              this.$message({
+                  message: res.msg,
+                  type: 'error'
+              })
+          }
+      }, err => {
+          this.notParticipatingInSharedProjectsLoading = false
+          this.$message({
+              message: err,
+              type: 'error'
+          })
+      })
+    },
+    notParticipatingInSharedProjects() {
+      this.notParticipatingInSharedProjectsValue = this.selectProjectBonusAllocation.map(item => item.projectId)
+      // this.notParticipatingInSharedProjectsTitle = this.selectMonth
+      this.notParticipatingInSharedProjectsTitle = ''
+      this.selectAllItems()
+      this.notParticipatingInSharedProjectsVisable = true
+    },
+    selectAllItems() {
+        if (this.notParticipatingInSharedAllProject) {
+            this.notParticipatingInSharedProjectDisabled = true
+        } else {
+            this.notParticipatingInSharedProjectDisabled = false
+        }
+    },
+    getSelectProjectBonusAllocation() {
+      this.http.get('/bonusExcludeProject/getProjects', res => {
+        const { isAll = 0, projectList } = res.data
+        this.selectProjectBonusAllocation = projectList || []
+        this.notParticipatingInSharedAllProject = isAll ? true : false
+      })
+    },
+    getAllProjectList() {
+        this.http.post('/project/getProjectList', {
+            pageIndex: -1,
+            pageSize: -1
+        }, res => {
+            this.projectAllList = res.data
+        })
+    },
     retrieveDataAgain() {
       this.getEchartsData()
       this.getTableList()