123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- <template>
- <div>
- <basic-container class="page-crad">
- <avue-crud ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
- :cell-style="cellStyle" @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
- @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
- @resetColumn="resetColumn" @search-criteria-switch="searchCriteriaSwitch">
- <template slot="menuLeft">
- <el-button type="info" size="small" @click="outExport">导出
- </el-button>
- </template>
- <template slot="userNameSearch">
- <user-select v-model="search.userName" :configuration="UConfiguration">
- </user-select>
- </template>
- <template slot="businesDateSearch">
- <el-date-picker v-model="search.businesDate" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']">
- </el-date-picker>
- </template>
- </avue-crud>
- </basic-container>
- </div>
- </template>
- <script>
- import { getToken } from "@/util/auth";
- import { getList } from "@/api/statisticAnalysis/taskStatistics"
- export default {
- name: "index",
- data() {
- return {
- UConfiguration: {
- multipleChoices: false,
- multiple: false,
- disabled: false,
- searchShow: true,
- collapseTags: false,
- placeholder: '请点击右边按钮选择',
- dicData: []
- },
- form: {},
- search: {},
- dataList: [],
- loading: false,
- detailData: {},
- page: {
- pageSize: 20,
- currentPage: 1,
- total: 0,
- pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
- },
- option: {},
- optionBack: {
- searchShow: true,
- searchMenuPosition: "right",
- searchSpan: 8,
- searchMenuSpan: 24,
- border: true,
- index: true,
- addBtn: false,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- searchIcon: true,
- menu: false,
- column: [
- {
- label: "承做人",
- prop: "userName",
- overHidden: true,
- search: true
- },
- {
- label: "业务日期",
- prop: "beginTime",
- type: "date",
- format: 'yyyy-MM-dd',
- valueFormat: 'yyyy-MM-dd',
- searchRange: true,
- overHidden: true,
- search: true,
- },
- {
- label: "客户名称",
- prop: "cornName",
- overHidden: true,
- },
- {
- label: "任务名称",
- prop: "pname",
- overHidden: true,
- },
- {
- label: "状态",
- prop: "taskStatus",
- search: true,
- type: "select",
- overHidden: true,
- dataType: 'number',
- dicData: [],
- props: {
- label: "dictValue",
- value: "dictKey"
- }
- }
- ]
- }
- };
- },
- async created() {
- this.option = await this.getColumnData(this.getColumnName(183), this.optionBack);
- this.getWorkDicts("task_status").then(res => {
- this.findObject(this.option.column, "taskStatus").dicData =
- res.data.data;
- });
- },
- methods: {
- cellStyle() {
- return "padding:0;height:40px;";
- },
- searchCriteriaSwitch(type) {
- if (type) {
- this.option.height = this.option.height - 46;
- } else {
- this.option.height = this.option.height + 46;
- }
- this.$refs.crud.getTableHeight();
- },
- //点击搜索按钮触发
- searchChange(params, done) {
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- refreshChange() {
- this.onLoad(this.page, this.search);
- },
- currentChange(val) {
- this.page.currentPage = val;
- },
- sizeChange(val) {
- this.page.currentPage = 1;
- this.page.pageSize = val;
- },
- onLoad(page, params = {}) {
- let data = this.deepClone(Object.assign({}, params, this.search));
- if (data.beginTime) {
- data.beginTimeStart = data.beginTime[0]
- data.beginTimeEnd = data.beginTime[1]
- delete data.beginTime
- }
- data.branch = "Y"
- this.loading = true;
- getList(
- page.currentPage,
- page.pageSize,
- Object.assign(data)
- ).then(res => {
- if (res.data.data.records) {
- res.data.data.records.forEach(e => {
- e.itemLoading = true;
- });
- }
- this.dataList = res.data.data.records ? res.data.data.records : [];
- this.page.total = res.data.data.total;
- if (this.page.total) {
- this.option.height = window.innerHeight - 210;
- }
- }).finally(() => {
- this.loading = false;
- });
- },
- //列保存触发
- async saveColumn() {
- const inSave = await this.saveColumnData(this.getColumnName(183), this.option);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }
- },
- async resetColumn() {
- this.option = this.optionBack;
- const inSave = await this.delColumnData(this.getColumnName(183), this.optionBack);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }
- },
- editOpen(row) {
- },
- outExport() {
- let queryParams = this.search
- if (queryParams.beginTime) {
- queryParams.beginTimeStart = queryParams.beginTime[0]
- queryParams.beginTimeEnd = queryParams.beginTime[1]
- delete queryParams.beginTime
- }
- const routeData = this.$router.resolve({
- path: '/api/trade-project/project/statisticsExport', //跳转目标窗口的地址
- query: {
- "Blade-Auth": getToken(),
- type: "RW",
- branch: "Y",
- ...queryParams //括号内是要传递给新窗口的参数
- }
- })
- window.open(routeData.href.slice(1, routeData.href.length - 1));
- }
- }
- };
- </script>
- <style scoped>
- .page-crad ::v-deep .basic-container__card {
- height: 94.2vh;
- }
- ::v-deep .el-table__expanded-cell[class*="cell"] {
- padding: 0px;
- }
- .itemTable ::v-deep .el-table {
- width: 100%;
- }
- </style>
|