|
@@ -35,6 +35,11 @@
|
|
|
<el-form-item style="float:right;" v-if="permissions.financialCustom">
|
|
|
<el-link type="primary" :underline="false" @click="showItemDialog()">{{ $t('Customizesalaryitems') }}</el-link>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item style="float:right;">
|
|
|
+ <el-link type="primary" :underline="false" @click="notParticipatingInSharedProjects()">
|
|
|
+ 不参与分摊项目设置
|
|
|
+ </el-link>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item style="float:right;" v-if="user.timeType.financeAudit == '1' && permissions.setFinanceAuditor">
|
|
|
<el-link type="primary" :underline="false" @click="reviewerVisible = true">{{ $t('Setupauditor') }}</el-link>
|
|
|
</el-form-item>
|
|
@@ -174,6 +179,29 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <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-checkbox v-model="notParticipatingInSharedAllProject" @change="selectAllItems">选中全部项目</el-checkbox>
|
|
|
+ <br />
|
|
|
+ <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>
|
|
|
+
|
|
|
|
|
|
|
|
|
<!--列表-->
|
|
@@ -233,7 +261,7 @@
|
|
|
|
|
|
<el-form-item style="float:right;margin-right:20px;" v-if="permissions.financialShare">
|
|
|
<el-link type="primary" :underline="false" @click="uploadTest()" v-if="user.companyId == 936" style="margin-right:10px">{{ $t('shangChuan') }}</el-link>
|
|
|
- <el-link type="primary" :underline="false" @click="exportFinanceDialog=true">{{ $t('ExportingtheAllocationData') }}</el-link>
|
|
|
+ <el-link type="primary" :underline="false" @click="exportFinanceDialog=true, personnelAllocation = true">{{ $t('ExportingtheAllocationData') }}</el-link>
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
@@ -575,6 +603,9 @@
|
|
|
<el-radio :label="0">{{ $t('Exportbyproject') }}</el-radio>
|
|
|
<el-radio :label="1">{{ $t('Exportbprojectcategory') }}</el-radio>
|
|
|
</el-radio-group>
|
|
|
+ <div style="margin-top: 20px;">
|
|
|
+ <el-checkbox v-model="personnelAllocation">含人员分摊明细</el-checkbox>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="exportData" :loading="exportDataProcessing" type="primary">{{ $t('export.export') }}</el-button>
|
|
@@ -621,6 +652,7 @@ import { error } from 'dingtalk-jsapi';
|
|
|
showMissingDialog: false,
|
|
|
missingFinanceUserList: [],
|
|
|
groupByCategory:0,
|
|
|
+ personnelAllocation: true,
|
|
|
exportFinanceDialog:false,
|
|
|
exportMonth:null,
|
|
|
exportDialog:false,
|
|
@@ -688,10 +720,83 @@ import { error } from 'dingtalk-jsapi';
|
|
|
chosenProjectsChecked: false,
|
|
|
exportDataProcessing: false,
|
|
|
|
|
|
- financialFlg: false
|
|
|
+ financialFlg: false,
|
|
|
+
|
|
|
+ projectAllList: [], // 全部项目
|
|
|
+ selectProjectList: [], // 分摊选中的项目
|
|
|
+ notParticipatingInSharedProjectsValue: [],
|
|
|
+ notParticipatingInSharedProjectsVisable: false,
|
|
|
+ notParticipatingInSharedProjectsTitle: '',
|
|
|
+ notParticipatingInSharedProjectsLoading: false,
|
|
|
+ notParticipatingInSharedAllProject: false,
|
|
|
+ notParticipatingInSharedProjectDisabled: false,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ selectAllItems() {
|
|
|
+ if(this.notParticipatingInSharedAllProject) {
|
|
|
+ this.notParticipatingInSharedProjectDisabled = true
|
|
|
+ } else {
|
|
|
+ this.notParticipatingInSharedProjectDisabled = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getTheCurrentMonth() {
|
|
|
+ const d = new Date();
|
|
|
+ const data = d.getFullYear() +'-'+ ((d.getMonth()+1) < 10? '0'+(d.getMonth()+1):d.getMonth()+1);
|
|
|
+ return data
|
|
|
+ },
|
|
|
+ getAllocateSelectedItems() {
|
|
|
+ this.http.get(`/financeExcludeProject/getProjects?useYM=${this.date || this.getTheCurrentMonth()}`,res => {
|
|
|
+ const { isAll = 0, projectList } = res.data
|
|
|
+ this.selectProjectList = projectList || []
|
|
|
+ this.notParticipatingInSharedAllProject = isAll ? true : false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getAllProjectList() {
|
|
|
+ this.http.post('/project/getProjectList',{
|
|
|
+ pageIndex: -1,
|
|
|
+ pageSize: -1
|
|
|
+ },res => {
|
|
|
+ this.projectAllList = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ submitNotParticipatingInSharedProject() {
|
|
|
+ // if((!this.notParticipatingInSharedProjectsValue || this.notParticipatingInSharedProjectsValue.length <= 0) && !this.notParticipatingInSharedAllProject) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '请选择项目',
|
|
|
+ // type: 'warning'
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ this.notParticipatingInSharedProjectsLoading = true
|
|
|
+ this.http.post('/financeExcludeProject/addOrUpdateProjects',{
|
|
|
+ projects: this.notParticipatingInSharedProjectsValue,
|
|
|
+ useYM: this.date,
|
|
|
+ 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'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
getMonthProjSetting() {
|
|
|
this.http.post('/cost-project-setting/get',{companyId: this.user.companyId, ymonth: this.date},res => {
|
|
|
if(res.code == 'ok'){
|
|
@@ -1235,6 +1340,12 @@ import { error } from 'dingtalk-jsapi';
|
|
|
this.customCols = JSON.parse(JSON.stringify(this.customColsi))
|
|
|
this.itemDialog = true;
|
|
|
},
|
|
|
+ notParticipatingInSharedProjects() {
|
|
|
+ this.notParticipatingInSharedProjectsValue = (this.selectProjectList || []).map(item => item.projectId)
|
|
|
+ this.notParticipatingInSharedProjectsTitle = this.date
|
|
|
+ this.selectAllItems()
|
|
|
+ this.notParticipatingInSharedProjectsVisable = true
|
|
|
+ },
|
|
|
//获取自定义的字段
|
|
|
getCustomColumn() {
|
|
|
this.http.post('/finance-tblcuscol/getAll', {companyId: this.user.companyId},
|
|
@@ -1426,7 +1537,10 @@ import { error } from 'dingtalk-jsapi';
|
|
|
exportData() {
|
|
|
this.exportDataProcessing = true;
|
|
|
this.http.post('/finance/exportData', {
|
|
|
- date: this.date, assignNoProUser: this.assignNoProUser, groupByCategory: this.groupByCategory
|
|
|
+ date: this.date,
|
|
|
+ assignNoProUser: this.assignNoProUser,
|
|
|
+ groupByCategory: this.groupByCategory,
|
|
|
+ onlyTotal: this.personnelAllocation ? 1 : 0
|
|
|
},
|
|
|
res => {
|
|
|
this.exportDataProcessing = false;
|
|
@@ -1490,6 +1604,8 @@ import { error } from 'dingtalk-jsapi';
|
|
|
this.getList();
|
|
|
this.assignToProject();
|
|
|
this.getMonths()
|
|
|
+
|
|
|
+ this.getAllocateSelectedItems()
|
|
|
},
|
|
|
// 批量导入人员薪资
|
|
|
importFinance(item) {
|
|
@@ -1861,6 +1977,8 @@ import { error } from 'dingtalk-jsapi';
|
|
|
this.arrter()
|
|
|
this.loadMonthData()
|
|
|
this.scrollFunction()
|
|
|
+ this.getAllProjectList()
|
|
|
+ this.getAllocateSelectedItems()
|
|
|
},
|
|
|
updated() {
|
|
|
this.$nextTick(() => {
|