Commit 7e36e428 authored by shangtx's avatar shangtx

Merge branch 'shang' into dev

parents b52cf1a6 06758090
...@@ -28,3 +28,16 @@ export function getAuxiliaryInfo(month) { ...@@ -28,3 +28,16 @@ export function getAuxiliaryInfo(month) {
method: 'get' method: 'get'
}); });
} }
/*
* 导出工时表
*/
export function exportExcel(parameter) {
return axios({
responseType: 'blob',
headers: {'Accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'},
url: `${baseUrl.taskEstimate}/export`,
method: 'post',
data: parameter,
})
}
\ No newline at end of file
...@@ -71,6 +71,9 @@ ...@@ -71,6 +71,9 @@
</span> </span>
<div class="cust-table-operator"> <div class="cust-table-operator">
<a-button-group> <a-button-group>
<a-button type="primary" @click="exportExcel" ghost>
导出
</a-button>
<a-button type="primary" @click="search">查询</a-button> <a-button type="primary" @click="search">查询</a-button>
<a-button @click="reset">重置</a-button> <a-button @click="reset">重置</a-button>
</a-button-group> </a-button-group>
...@@ -98,7 +101,7 @@ ...@@ -98,7 +101,7 @@
</template> </template>
<script> <script>
import { getPage, getAuxiliaryInfo } from "@/api/task/task"; import { getPage, getAuxiliaryInfo, exportExcel } from "@/api/task/task";
import { getSelectableProjects } from "@/api/project/project"; import { getSelectableProjects } from "@/api/project/project";
import { humpToLine, setOrder } from "@/util/util"; import { humpToLine, setOrder } from "@/util/util";
import moment from "moment"; import moment from "moment";
...@@ -291,6 +294,14 @@ export default { ...@@ -291,6 +294,14 @@ export default {
// 重新计算当月天数 // 重新计算当月天数
this.dayOfTheMonth = date.daysInMonth(); this.dayOfTheMonth = date.daysInMonth();
}, },
exportExcel() {
exportExcel(this.query).then((response) => {
let fileDownload = require("js-file-download");
fileDownload(response.data, `${this.query.month}${
this.query.projectId? this.projectOptions.filter(p => p.value == this.query.projectId)[0].title : ''}工时明细.xlsx`);
this.loading = false;
});
},
}, },
mounted() { mounted() {
getSelectableProjects().then(({ data }) => { getSelectableProjects().then(({ data }) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment