|
@@ -3,129 +3,144 @@
|
|
:before-close="handleClose">
|
|
:before-close="handleClose">
|
|
<el-form ref="exportFormRef" :model="exportParam">
|
|
<el-form ref="exportFormRef" :model="exportParam">
|
|
<!-- 头部 -->
|
|
<!-- 头部 -->
|
|
- <div style="text-align: center;margin-bottom: 20px">
|
|
|
|
|
|
+ <div style="text-align: center;margin-bottom: 20px" v-if="singleChoiceType != '设备'">
|
|
<el-radio-group size="medium" v-model="exportParam.reportType">
|
|
<el-radio-group size="medium" v-model="exportParam.reportType">
|
|
<el-radio-button :label="0">常规报表</el-radio-button>
|
|
<el-radio-button :label="0">常规报表</el-radio-button>
|
|
<el-radio-button :label="1">月度报表</el-radio-button>
|
|
<el-radio-button :label="1">月度报表</el-radio-button>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</div>
|
|
</div>
|
|
- <!-- 常规报表 -->
|
|
|
|
- <template v-if="exportParam.reportType == 0">
|
|
|
|
|
|
|
|
- <el-form-item prop="projectCategoryId" :label="$t('projectclassification')"
|
|
|
|
- v-if="singleChoiceType == $t('projectclassification') || singleChoiceType == $t('other.project')">
|
|
|
|
- <el-select v-model="exportParam.projectCategoryId" :placeholder="$t('classificationitems')" clearable
|
|
|
|
- style="width:350px;" filterable="true" @change="filterCategory">
|
|
|
|
- <el-option v-for="item in categoryList" :key="item.id" :label="item.name" :value="item.id">
|
|
|
|
- </el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <template v-if="singleChoiceType != '设备'">
|
|
|
|
+ <!-- 常规报表 -->
|
|
|
|
+ <template v-if="exportParam.reportType == 0">
|
|
|
|
|
|
- <el-form-item prop="projectId" :label="'选择项目'" v-if="!['人员', '项目分类', '部门', '主项目'].includes(singleChoiceType)">
|
|
|
|
- <select-project v-model="exportParam.projectId" :size="'medium'" :placeholder="'全部项目'" width="350px"
|
|
|
|
- clearable></select-project>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <el-form-item prop="projectCategoryId" :label="$t('projectclassification')"
|
|
|
|
+ v-if="singleChoiceType == $t('projectclassification') || singleChoiceType == $t('other.project')">
|
|
|
|
+ <el-select v-model="exportParam.projectCategoryId" :placeholder="$t('classificationitems')" clearable
|
|
|
|
+ style="width:350px;" filterable="true" @change="filterCategory">
|
|
|
|
+ <el-option v-for="item in categoryList" :key="item.id" :label="item.name" :value="item.id">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-form-item prop="exportContent" :label="$t('daoChuNeiRon')"
|
|
|
|
- v-if="permissions.countCost && permissions.countHours && (['项目', '项目分类'].includes(singleChoiceType))">
|
|
|
|
- <el-select v-model="exportParam.exportContent" style="width:350px;" filterable="true"
|
|
|
|
- popper-class="projectSelectPopperClass">
|
|
|
|
- <el-option :label="$t('gongShiHeChengBen')" value="hoursAndCost"></el-option>
|
|
|
|
- <el-option :label="$t('jingGongShi')" value="hours"></el-option>
|
|
|
|
- <el-option :label="$t('jingChenBen')" value="cost"></el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <el-form-item prop="projectId" :label="'选择项目'" v-if="!['人员', '项目分类', '部门', '主项目'].includes(singleChoiceType)">
|
|
|
|
+ <select-project v-model="exportParam.projectId" :size="'medium'" :placeholder="'全部项目'" width="350px"
|
|
|
|
+ clearable></select-project>
|
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-form-item :label="$t('departmentchoice')" v-if="singleChoiceType == $t('other.project')">
|
|
|
|
- <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="exportParam.deptId" :options="departmentList"
|
|
|
|
- :placeholder="$t('defaultText.pleaseChoose')" :props="{ checkStrictly: true, expandTrigger: 'hover' }"
|
|
|
|
- clearable filterable style="width:350px;"></el-cascader>
|
|
|
|
|
|
+ <el-form-item prop="exportContent" :label="$t('daoChuNeiRon')"
|
|
|
|
+ v-if="permissions.countCost && permissions.countHours && (['项目', '项目分类'].includes(singleChoiceType))">
|
|
|
|
+ <el-select v-model="exportParam.exportContent" style="width:350px;" filterable="true"
|
|
|
|
+ popper-class="projectSelectPopperClass">
|
|
|
|
+ <el-option :label="$t('gongShiHeChengBen')" value="hoursAndCost"></el-option>
|
|
|
|
+ <el-option :label="$t('jingGongShi')" value="hours"></el-option>
|
|
|
|
+ <el-option :label="$t('jingChenBen')" value="cost"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subject="departmentList" :radios="true"
|
|
|
|
- :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <el-form-item :label="$t('departmentchoice')" v-if="singleChoiceType == $t('other.project')">
|
|
|
|
+ <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="exportParam.deptId" :options="departmentList"
|
|
|
|
+ :placeholder="$t('defaultText.pleaseChoose')" :props="{ checkStrictly: true, expandTrigger: 'hover' }"
|
|
|
|
+ clearable filterable style="width:350px;"></el-cascader>
|
|
|
|
|
|
- <el-form-item prop="userIds" :label="$t('screening.selectPeople')" v-if="singleChoiceType == $t('ren-yuan')">
|
|
|
|
- <el-select v-if="user.userNameNeedTranslate != '1'" v-model="exportParam.userIds"
|
|
|
|
- :placeholder="$t('lable.allStaff')" multiple="true" clearable style="width:350px;" filterable="true">
|
|
|
|
- <el-option v-for="item in hasReportUserList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subject="departmentList" :radios="true"
|
|
|
|
+ :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
|
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'350'" :filterable="true"
|
|
|
|
- :subject="hasReportUserList" :clearable="true" :multiSelect="true" @selectCal="selectCal"
|
|
|
|
- :distinction="'1'"></selectCat>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <el-form-item prop="userIds" :label="$t('screening.selectPeople')" v-if="singleChoiceType == $t('ren-yuan')">
|
|
|
|
+ <el-select v-if="user.userNameNeedTranslate != '1'" v-model="exportParam.userIds"
|
|
|
|
+ :placeholder="$t('lable.allStaff')" multiple="true" clearable style="width:350px;" filterable="true">
|
|
|
|
+ <el-option v-for="item in hasReportUserList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
|
|
- <el-form-item prop="userIds" :label="$t('screening.selectPeople')"
|
|
|
|
- v-if="['项目', '项目分类'].includes(singleChoiceType)">
|
|
|
|
- <el-select v-if="user.userNameNeedTranslate != '1'" v-model="exportParam.userIds"
|
|
|
|
- :placeholder="$t('lable.allStaff')" multiple="true" clearable style="width:350px;" filterable="true">
|
|
|
|
- <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'350'" :filterable="true"
|
|
|
|
+ :subject="hasReportUserList" :clearable="true" :multiSelect="true" @selectCal="selectCal"
|
|
|
|
+ :distinction="'1'"></selectCat>
|
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'350'" :filterable="true"
|
|
|
|
- :subject="users" :clearable="true" :multiSelect="true" @selectCal="selectCal" :distinction="'1'">
|
|
|
|
- </selectCat>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <el-form-item prop="userIds" :label="$t('screening.selectPeople')"
|
|
|
|
+ v-if="['项目', '项目分类'].includes(singleChoiceType)">
|
|
|
|
+ <el-select v-if="user.userNameNeedTranslate != '1'" v-model="exportParam.userIds"
|
|
|
|
+ :placeholder="$t('lable.allStaff')" multiple="true" clearable style="width:350px;" filterable="true">
|
|
|
|
+ <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
|
|
- <el-form-item prop="projectId"
|
|
|
|
- :label="user.timeType.fixMonthcost == 0 ? $t('time.dateRange') : $t('Selectmonth')">
|
|
|
|
- <el-date-picker v-show="user.timeType.fixMonthcost == 0" v-model="exportParam.dateRange" :editable="false"
|
|
|
|
- format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" :range-separator="$t('other.to')"
|
|
|
|
- type="daterange" :start-placeholder="$t('time.startDate')"
|
|
|
|
- :end-placeholder="$t('time.endDate')"></el-date-picker>
|
|
|
|
|
|
+ <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'350'" :filterable="true"
|
|
|
|
+ :subject="users" :clearable="true" :multiSelect="true" @selectCal="selectCal" :distinction="'1'">
|
|
|
|
+ </selectCat>
|
|
|
|
+ </el-form-item>
|
|
|
|
|
|
|
|
+ <el-form-item prop="projectId"
|
|
|
|
+ :label="user.timeType.fixMonthcost == 0 ? $t('time.dateRange') : $t('Selectmonth')">
|
|
|
|
+ <el-date-picker v-show="user.timeType.fixMonthcost == 0" v-model="exportParam.dateRange" :editable="false"
|
|
|
|
+ format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" :range-separator="$t('other.to')"
|
|
|
|
+ type="daterange" :start-placeholder="$t('time.startDate')"
|
|
|
|
+ :end-placeholder="$t('time.endDate')"></el-date-picker>
|
|
|
|
|
|
- <el-date-picker v-show="user.timeType.fixMonthcost == 1" v-model="dateRange" :editable="false"
|
|
|
|
- format="yyyy-MM" value-format="yyyy-MM" @change="getEchart" :clearable="true" type="month"></el-date-picker>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
|
- <el-form-item :label="$t('screening.selectPeople')" v-if="false">
|
|
|
|
- <el-select v-if="user.userNameNeedTranslate != '1'" v-model="exportParam.userId"
|
|
|
|
- :placeholder="$t('lable.allStaff')" style="width: 350px" filterable="true" clearable="true">
|
|
|
|
- <span v-for="(item, index) in users" :key="index">
|
|
|
|
- <el-option :label="item.name" :value="item.id"></el-option>
|
|
|
|
- </span>
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ <el-date-picker v-show="user.timeType.fixMonthcost == 1" v-model="dateRange" :editable="false"
|
|
|
|
+ format="yyyy-MM" value-format="yyyy-MM" @change="getEchart" :clearable="true" type="month"></el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :distinction="'4'" :widthStr="'350'"
|
|
|
|
- :subject="users" :clearable="true" @selectCal="selectCal"></selectCat>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <el-form-item :label="$t('screening.selectPeople')" v-if="false">
|
|
|
|
+ <el-select v-if="user.userNameNeedTranslate != '1'" v-model="exportParam.userId"
|
|
|
|
+ :placeholder="$t('lable.allStaff')" style="width: 350px" filterable="true" clearable="true">
|
|
|
|
+ <span v-for="(item, index) in users" :key="index">
|
|
|
|
+ <el-option :label="item.name" :value="item.id"></el-option>
|
|
|
|
+ </span>
|
|
|
|
+ </el-select>
|
|
|
|
|
|
- <el-form-item prop="type" :label="$t('choosethestyle')" v-if="['项目', '项目分类'].includes(singleChoiceType)">
|
|
|
|
- <el-select v-model="exportParam.type" :placeholder="$t('choosethestyle')" style="width:350px;">
|
|
|
|
- <el-option
|
|
|
|
- :label="singleChoiceType == $t('projectclassification') ? $t('classifiedontheline') : $t('Itemontheline')"
|
|
|
|
- value="0"></el-option>
|
|
|
|
- <el-option
|
|
|
|
- :label="singleChoiceType == $t('projectclassification') ? $t('classifiedcolumns') : $t('itemisonthecolumn')"
|
|
|
|
- value="1"></el-option>
|
|
|
|
- </el-select>
|
|
|
|
- <div class="prompt">
|
|
|
|
- <el-popover placement="top" width="1200" trigger="hover">
|
|
|
|
- <img src="../../assets/image/hanglie.png" alt="" width="100%"
|
|
|
|
- v-if="this.singleChoiceType != $t('projectclassification')">
|
|
|
|
- <img src="../../assets/image/hanglie_corp.png" alt="" width="100%" v-else>
|
|
|
|
- <i class="el-icon-question" slot="reference" />
|
|
|
|
- </el-popover>
|
|
|
|
- </div>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :distinction="'4'" :widthStr="'350'"
|
|
|
|
+ :subject="users" :clearable="true" @selectCal="selectCal"></selectCat>
|
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-form-item
|
|
|
|
- v-if="exportParam.type == 1 && permissions.countHours && (singleChoiceType == $t('other.project'))">
|
|
|
|
- <el-checkbox v-model="exportParam.withPercent">{{ $t('gongHhiZhanbiXmu') }}</el-checkbox>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <el-form-item prop="type" :label="$t('choosethestyle')" v-if="['项目', '项目分类'].includes(singleChoiceType)">
|
|
|
|
+ <el-select v-model="exportParam.type" :placeholder="$t('choosethestyle')" style="width:350px;">
|
|
|
|
+ <el-option
|
|
|
|
+ :label="singleChoiceType == $t('projectclassification') ? $t('classifiedontheline') : $t('Itemontheline')"
|
|
|
|
+ value="0"></el-option>
|
|
|
|
+ <el-option
|
|
|
|
+ :label="singleChoiceType == $t('projectclassification') ? $t('classifiedcolumns') : $t('itemisonthecolumn')"
|
|
|
|
+ value="1"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ <div class="prompt">
|
|
|
|
+ <el-popover placement="top" width="1200" trigger="hover">
|
|
|
|
+ <img src="../../assets/image/hanglie.png" alt="" width="100%"
|
|
|
|
+ v-if="this.singleChoiceType != $t('projectclassification')">
|
|
|
|
+ <img src="../../assets/image/hanglie_corp.png" alt="" width="100%" v-else>
|
|
|
|
+ <i class="el-icon-question" slot="reference" />
|
|
|
|
+ </el-popover>
|
|
|
|
+ </div>
|
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-form-item v-if="['项目', '项目分类', '主项目'].includes(singleChoiceType) && exportParam.type == '0'">
|
|
|
|
- <el-checkbox v-model="exportParam.projectSum">{{ $t('individualprojectdata') }}</el-checkbox>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <el-form-item
|
|
|
|
+ v-if="exportParam.type == 1 && permissions.countHours && (singleChoiceType == $t('other.project'))">
|
|
|
|
+ <el-checkbox v-model="exportParam.withPercent">{{ $t('gongHhiZhanbiXmu') }}</el-checkbox>
|
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-form-item v-if="singleChoiceType == $t('ren-yuan') && user.timeType.mainProjectState == 1">
|
|
|
|
- <el-checkbox v-model="exportParam.mainProjectColumn">{{ $t('hanZhuXiangMu') }}</el-checkbox>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <el-form-item v-if="['项目', '项目分类', '主项目'].includes(singleChoiceType) && exportParam.type == '0'">
|
|
|
|
+ <el-checkbox v-model="exportParam.projectSum">{{ $t('individualprojectdata') }}</el-checkbox>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <el-form-item v-if="singleChoiceType == $t('ren-yuan') && user.timeType.mainProjectState == 1">
|
|
|
|
+ <el-checkbox v-model="exportParam.mainProjectColumn">{{ $t('hanZhuXiangMu') }}</el-checkbox>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 月度报表 -->
|
|
|
|
+ <template v-if="exportParam.reportType == 1">
|
|
|
|
+ <el-form-item prop="date" :label="this.$t('Selectmonth')">
|
|
|
|
+ <el-date-picker size="small" v-model="exportParam.date" :editable="false" format="yyyy-MM"
|
|
|
|
+ value-format="yyyy-MM" :clearable="false" type="month" :placeholder="$t('Selectmonth')"
|
|
|
|
+ style="margin-right: 20px"></el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
</template>
|
|
</template>
|
|
- <!-- 月度报表 -->
|
|
|
|
- <template v-if="exportParam.reportType == 1">
|
|
|
|
|
|
+
|
|
|
|
+ <template v-if="singleChoiceType == '设备'">
|
|
|
|
+ <el-form-item prop="projectId" :label="'选择项目'">
|
|
|
|
+ <select-project v-model="exportParam.projectId" :size="'medium'" :placeholder="'全部项目'" width="350px"
|
|
|
|
+ clearable></select-project>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item prop="date" :label="this.$t('Selectmonth')">
|
|
<el-form-item prop="date" :label="this.$t('Selectmonth')">
|
|
<el-date-picker size="small" v-model="exportParam.date" :editable="false" format="yyyy-MM"
|
|
<el-date-picker size="small" v-model="exportParam.date" :editable="false" format="yyyy-MM"
|
|
value-format="yyyy-MM" :clearable="false" type="month" :placeholder="$t('Selectmonth')"
|
|
value-format="yyyy-MM" :clearable="false" type="month" :placeholder="$t('Selectmonth')"
|
|
@@ -137,7 +152,9 @@
|
|
<!-- 导出按钮 -->
|
|
<!-- 导出按钮 -->
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="exportParam.reportType == 0 ? exportProjectData() : exportMonthlyProjectData()"
|
|
<el-button type="primary" @click="exportParam.reportType == 0 ? exportProjectData() : exportMonthlyProjectData()"
|
|
- style="width:100%;" :loading="exporting">{{ $t('export.export') }}</el-button>
|
|
|
|
|
|
+ style="width:100%;" :loading="exporting" v-if="singleChoiceType != '设备'">{{ $t('export.export') }}</el-button>
|
|
|
|
+ <el-button type="primary" @click="deviceExport()"
|
|
|
|
+ style="width:100%;" :loading="exporting" v-if="singleChoiceType == '设备'">{{ $t('export.export') }}</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</template>
|
|
</template>
|
|
@@ -200,6 +217,21 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ deviceExport() {
|
|
|
|
+ var url = '/device-log/exportDeviceTimeCostByMonth';
|
|
|
|
+ var fileName = this.exportParam.date + '设备月度统计表.xlsx';
|
|
|
|
+ const { projectId, date } = this.exportParam
|
|
|
|
+ this.exporting = true;
|
|
|
|
+ this.postData(url, { projectId, date }).then((res) => {
|
|
|
|
+ const aTag = document.createElement('a');
|
|
|
|
+ aTag.download = fileName;
|
|
|
|
+ aTag.href = res.data;
|
|
|
|
+ aTag.click()
|
|
|
|
+ }).finally(() => {
|
|
|
|
+ this.exporting = false
|
|
|
|
+ this.updateValue()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
exportMonthlyProjectData() {
|
|
exportMonthlyProjectData() {
|
|
var url = '/project/exportTimeByProjectAndEmployee';
|
|
var url = '/project/exportTimeByProjectAndEmployee';
|
|
var fileName = this.exportParam.date + '月度工时统计表.xlsx';
|
|
var fileName = this.exportParam.date + '月度工时统计表.xlsx';
|