|
@@ -669,11 +669,13 @@
|
|
|
<el-option v-for="item in allPlanList" :key="item.id" :label="item.productName" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item> -->
|
|
|
- <el-form-item prop="departmentId" :label="'选择工位'" v-if="permissions.reportsCompany">
|
|
|
+ <el-form-item :label="'选择工位'" v-if="permissions.reportsCompany">
|
|
|
|
|
|
- <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="exportParam.departmentId" :placeholder="$t('other.allDepartments')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
|
|
|
-
|
|
|
- <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
|
|
|
+ <!-- 部门筛选 -->
|
|
|
+ <el-cascader v-model="departmentIdArray" :options="departmentList" :placeholder="$t('qing-xuan-ze-bu-men')"
|
|
|
+ :props="{ multiple: true, checkStrictly: true,expandTrigger: 'hover' }" collapse-tags :show-all-levels="false" clearable
|
|
|
+ size="small" style="margin-bottom: 10px;width:180px"
|
|
|
+ ></el-cascader>
|
|
|
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="projectId" :label="$t('time.dateRange')">
|
|
@@ -1379,7 +1381,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
+ props:{ multiple: true },
|
|
|
checkTypeTxt:['自检','互检','专检'],
|
|
|
modItemDataId: null,
|
|
|
modImportTime: null,
|
|
@@ -1465,7 +1467,7 @@
|
|
|
weekDay : [this.$t('weekDay.sunday'), this.$t('weekDay.monday'), this.$t('weekDay.tuesday'), this.$t('weekDay.wednesday'), this.$t('weekDay.thursday'), this.$t('weekDay.friday'), this.$t('weekDay.saturday')],
|
|
|
statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
|
|
|
fillStatusList: [],
|
|
|
- exportParam:{projectId: null, dateRange:[], departmentId: null},
|
|
|
+ exportParam:{projectId: null, dateRange:[], deptIds: null},
|
|
|
exportDialog:false,
|
|
|
timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
|
|
|
subProjectList:[],
|
|
@@ -1653,6 +1655,7 @@
|
|
|
totalReportHours: 0, // 合计的工时
|
|
|
|
|
|
allPlanList: [], // 所有计划
|
|
|
+ departmentIdArray:[],
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -1697,7 +1700,7 @@
|
|
|
this.exportParam.dateRange = [startStr,t];
|
|
|
this.getAllDate(1);
|
|
|
this.getReportList();
|
|
|
-
|
|
|
+ this.getDepartmentList()
|
|
|
// this.getFillProjectList();
|
|
|
// this.getTimeType();
|
|
|
this.getDepartment();
|
|
@@ -3856,7 +3859,25 @@
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ getDepartmentList() {
|
|
|
+ this.http.post( this.port.manage.depList, {},
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ let dptlist = JSON.parse(JSON.stringify(res.data));
|
|
|
+ this.departmentList = this.changeArr(dptlist);
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
// 获取部门列表
|
|
|
getDepartment() {
|
|
|
let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
|
|
@@ -3871,7 +3892,7 @@
|
|
|
// })
|
|
|
return
|
|
|
}
|
|
|
- this.departmentList = JSON.parse(JSON.stringify(res.data))
|
|
|
+ // this.departmentList = JSON.parse(JSON.stringify(res.data))
|
|
|
var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
|
|
|
// let noAllData = JSON.parse(JSON.stringify(res.data));
|
|
|
// if (this.user.role > 0) {
|
|
@@ -4311,20 +4332,28 @@
|
|
|
//导出日报
|
|
|
exportReport() {
|
|
|
this.listLoading = true;
|
|
|
+ var fName ='日报统计表_' + '.xlsx';
|
|
|
var param = {};
|
|
|
const { dateRange, departmentId } = this.exportParam
|
|
|
param.startDate = dateRange[0]
|
|
|
param.endDate = dateRange[1]
|
|
|
- console.log(departmentId)
|
|
|
- if(departmentId && departmentId.length > 0) {
|
|
|
- param.departmentId = departmentId[departmentId.length - 1]
|
|
|
+ let deptArr = []
|
|
|
+ for(var i in this.departmentIdArray){
|
|
|
+ let itemList = this.departmentIdArray[i]
|
|
|
+ deptArr.push(itemList[itemList.length - 1])
|
|
|
}
|
|
|
+ param.deptIds = deptArr.join(',')
|
|
|
this.http.post('/report/exportReport', param,
|
|
|
res => {
|
|
|
this.listLoading = false;
|
|
|
if (res.code == "ok") {
|
|
|
- location.href = res.data;
|
|
|
+ var filePath = res.data;
|
|
|
this.exportDialog = false;
|
|
|
+ const a = document.createElement('a'); // 创建a标签
|
|
|
+ a.setAttribute('download', fName);// download属性
|
|
|
+ a.setAttribute('href', filePath);// href链接
|
|
|
+ a.click(); //自执行点击事件
|
|
|
+ a.remove();
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|