|
@@ -9,10 +9,16 @@
|
|
<el-form-item :label="this.$t('Selectmonth')">
|
|
<el-form-item :label="this.$t('Selectmonth')">
|
|
<el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM"
|
|
<el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM"
|
|
value-format="yyyy-MM" @change="loadMonthData" :clearable="false" type="month"
|
|
value-format="yyyy-MM" @change="loadMonthData" :clearable="false" type="month"
|
|
- :placeholder="$t('Selectmonth')" style="margin-right: 20px"></el-date-picker>
|
|
|
|
|
|
+ :placeholder="$t('Selectmonth')" style="margin-right: 20px;width: 120px"></el-date-picker>
|
|
<el-link type="primary" :underline="false" @click="audits()"
|
|
<el-link type="primary" :underline="false" @click="audits()"
|
|
v-if="user.timeType.financeAudit == '1'">{{ revaelse }}</el-link>
|
|
v-if="user.timeType.financeAudit == '1'">{{ revaelse }}</el-link>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="部门">
|
|
|
|
+ <el-cascader v-model="departmentId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width: 160px" @change="loadMonthData"
|
|
|
|
+ :options="departmentArray" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable v-if="user.userNameNeedTranslate != 1" size="small"></el-cascader>
|
|
|
|
+
|
|
|
|
+ <vueCascader :size="'small'" :widthStr="'160'" :clearable="true && user.userNameNeedTranslate != 1" :subject="departmentArray" :subjectId="departmentId" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" ></vueCascader>
|
|
|
|
+ </el-form-item>
|
|
<!-- <el-radio-group v-model="radio" @change="switchList" style="margin-left:160px;margin-top:5px;"> -->
|
|
<!-- <el-radio-group v-model="radio" @change="switchList" style="margin-left:160px;margin-top:5px;"> -->
|
|
<el-radio-group size="small" v-model="radio" @change="switchList"
|
|
<el-radio-group size="small" v-model="radio" @change="switchList"
|
|
style="margin-left:150px;margin-top:5px;">
|
|
style="margin-left:150px;margin-top:5px;">
|
|
@@ -795,10 +801,13 @@ import { error } from 'dingtalk-jsapi';
|
|
import util from "../../../common/js/util";
|
|
import util from "../../../common/js/util";
|
|
// 自定义select组件
|
|
// 自定义select组件
|
|
import selectCat from "@/components/select.vue"
|
|
import selectCat from "@/components/select.vue"
|
|
|
|
+ // 引入自定义级联组件
|
|
|
|
+import vueCascader from "@/components/cascader.vue"
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
- selectCat
|
|
|
|
|
|
+ selectCat,
|
|
|
|
+ vueCascader
|
|
},
|
|
},
|
|
props: {
|
|
props: {
|
|
typeOfFunds: {
|
|
typeOfFunds: {
|
|
@@ -895,9 +904,62 @@ export default {
|
|
notParticipatingInSharedProjectsLoading: false,
|
|
notParticipatingInSharedProjectsLoading: false,
|
|
notParticipatingInSharedAllProject: false,
|
|
notParticipatingInSharedAllProject: false,
|
|
notParticipatingInSharedProjectDisabled: false,
|
|
notParticipatingInSharedProjectDisabled: false,
|
|
|
|
+ departmentId: '',
|
|
|
|
+ departmentArray: []
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 获取部门列表
|
|
|
|
+ getDepartment() {
|
|
|
|
+ this.http.post(
|
|
|
|
+ this.port.manage.depList,
|
|
|
|
+ {},
|
|
|
|
+ (res) => {
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ var list = res.data,
|
|
|
|
+ list1 = JSON.parse(JSON.stringify(res.data));
|
|
|
|
+ list.splice(0, 0, {
|
|
|
|
+ id: -1,
|
|
|
|
+ label: this.$t('lable.allStaff'),
|
|
|
|
+ });
|
|
|
|
+ list.push({
|
|
|
|
+ id: 0,
|
|
|
|
+ label: this.$t('lable.unassigned'),
|
|
|
|
+ });
|
|
|
|
+ this.departmentArray = this.changeArr(list1);
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ (error) => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: error,
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ // 修改数组
|
|
|
|
+ changeArr(arr) {
|
|
|
|
+ for (var i = 0; i < arr.length; i++) {
|
|
|
|
+ if (arr[i].id != -1 && arr[i].id != 0) {
|
|
|
|
+ if (arr[i].children != null && arr[i].children.length > 0) {
|
|
|
|
+ arr[i].children = this.changeArr(arr[i].children);
|
|
|
|
+ }
|
|
|
|
+ arr[i].id && (arr[i].value = arr[i].id);
|
|
|
|
+ delete arr[i].id;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for (var i in arr) {
|
|
|
|
+ if (arr[i].id == -1 || arr[i].id == 0) {
|
|
|
|
+ arr.splice(i, 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return arr;
|
|
|
|
+ },
|
|
switchMenu() {
|
|
switchMenu() {
|
|
this.$emit('switchMenu')
|
|
this.$emit('switchMenu')
|
|
},
|
|
},
|
|
@@ -1098,7 +1160,8 @@ export default {
|
|
exportFinance() {
|
|
exportFinance() {
|
|
this.isUploading = true;
|
|
this.isUploading = true;
|
|
this.http.post('/finance/exportFinance', {
|
|
this.http.post('/finance/exportFinance', {
|
|
- date: this.exportMonth
|
|
|
|
|
|
+ date: this.exportMonth,
|
|
|
|
+ deptId: this.departmentId[this.departmentId.length - 1]
|
|
}, res => {
|
|
}, res => {
|
|
this.isUploading = false;
|
|
this.isUploading = false;
|
|
if (res.code == 'ok') {
|
|
if (res.code == 'ok') {
|
|
@@ -1583,7 +1646,11 @@ export default {
|
|
// },
|
|
// },
|
|
assignToProject() {
|
|
assignToProject() {
|
|
var _this = this;
|
|
var _this = this;
|
|
- this.http.post('/finance/getTimeCost', { yearMonth: this.date, assignNoProUser: this.assignNoProUser },
|
|
|
|
|
|
+ this.http.post('/finance/getTimeCost', {
|
|
|
|
+ yearMonth: this.date,
|
|
|
|
+ assignNoProUser: this.assignNoProUser,
|
|
|
|
+ deptId: this.departmentId[this.departmentId.length - 1]
|
|
|
|
+ },
|
|
res => {
|
|
res => {
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
|
|
|
|
@@ -1717,7 +1784,8 @@ export default {
|
|
date: this.date,
|
|
date: this.date,
|
|
assignNoProUser: this.assignNoProUser,
|
|
assignNoProUser: this.assignNoProUser,
|
|
groupByCategory: this.groupByCategory,
|
|
groupByCategory: this.groupByCategory,
|
|
- onlyTotal: this.personnelAllocation ? 1 : 0
|
|
|
|
|
|
+ onlyTotal: this.personnelAllocation ? 1 : 0,
|
|
|
|
+ deptId: this.departmentId[this.departmentId.length - 1]
|
|
},
|
|
},
|
|
res => {
|
|
res => {
|
|
this.exportDataProcessing = false;
|
|
this.exportDataProcessing = false;
|
|
@@ -1781,9 +1849,14 @@ export default {
|
|
this.getList();
|
|
this.getList();
|
|
this.assignToProject();
|
|
this.assignToProject();
|
|
this.getMonths()
|
|
this.getMonths()
|
|
-
|
|
|
|
this.getAllocateSelectedItems()
|
|
this.getAllocateSelectedItems()
|
|
},
|
|
},
|
|
|
|
+ vueCasader(obj) {
|
|
|
|
+ if(obj.distinction == '1') {
|
|
|
|
+ this.departmentId = [obj.id]
|
|
|
|
+ this.loadMonthData()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 批量导入人员薪资
|
|
// 批量导入人员薪资
|
|
importFinance(item) {
|
|
importFinance(item) {
|
|
//首先判断文件类型
|
|
//首先判断文件类型
|
|
@@ -1879,7 +1952,8 @@ export default {
|
|
this.listLoading = true;
|
|
this.listLoading = true;
|
|
this.http.post('/finance/getByMonth', {
|
|
this.http.post('/finance/getByMonth', {
|
|
companyId: this.user.companyId,
|
|
companyId: this.user.companyId,
|
|
- yearMonth: this.date
|
|
|
|
|
|
+ yearMonth: this.date,
|
|
|
|
+ deptId: this.departmentId[this.departmentId.length - 1]
|
|
},
|
|
},
|
|
res => {
|
|
res => {
|
|
this.listLoading = false;
|
|
this.listLoading = false;
|
|
@@ -2156,6 +2230,8 @@ export default {
|
|
this.scrollFunction()
|
|
this.scrollFunction()
|
|
this.getAllProjectList()
|
|
this.getAllProjectList()
|
|
this.getAllocateSelectedItems()
|
|
this.getAllocateSelectedItems()
|
|
|
|
+
|
|
|
|
+ this.getDepartment()
|
|
},
|
|
},
|
|
updated() {
|
|
updated() {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|