Commit b62e2f85 authored by “yiyousong”'s avatar “yiyousong”

pref:修改报表

parent 0b36eb6d
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
<div class="callRecord-Container"> <div class="callRecord-Container">
<div class="header_box"> <div class="header_box">
<div> <div>
<a-button type="success" @click="handleExportTable"> <a-button
:loading="btnLoading"
type="success"
@click="handleExportTable"
>
<span>{{ tableSelectedRows.length ? "导出" : "导出全部" }}</span> <span>{{ tableSelectedRows.length ? "导出" : "导出全部" }}</span>
</a-button> </a-button>
<b <b
...@@ -34,13 +38,13 @@ ...@@ -34,13 +38,13 @@
<!-- </a-input-group> --> <!-- </a-input-group> -->
<a-range-picker <a-range-picker
format="YYYY年MM月DD日" format="YYYY年MM月DD日"
valueFormat="YYYY-MM-DD"
class="range_picker_style" class="range_picker_style"
v-model="BegindAndEndTime" v-model="BegindAndEndTime"
@change="rangePickerChange"
> >
</a-range-picker> </a-range-picker>
<a-button type="primary" @click="togetPrintList">搜索</a-button> <a-button type="primary" @click="handleSearch">搜索</a-button>
<a-button @click="handleReset">重置</a-button> <a-button @click="handleReset">重置</a-button>
</a-space> </a-space>
</span> </span>
...@@ -97,6 +101,7 @@ export default { ...@@ -97,6 +101,7 @@ export default {
name: "fillForm", name: "fillForm",
data() { data() {
return { return {
btnLoading: false,
tableHeaders: [ tableHeaders: [
{ {
title: "序号", title: "序号",
...@@ -198,7 +203,7 @@ export default { ...@@ -198,7 +203,7 @@ export default {
"matterName", "matterName",
"matterFullName", "matterFullName",
"materialName", "materialName",
"materiaFullName", "materialFullName",
"idName", "idName",
"idCard", "idCard",
"mobile", "mobile",
...@@ -219,73 +224,18 @@ export default { ...@@ -219,73 +224,18 @@ export default {
}, },
}, },
methods: { methods: {
//导出
toexportTable() {
let tableData = [];
if (this.tableSelectedRows.length == 0) {
let pramse = {
page: this.tablePagination.current,
size: this.tablePagination.pageSize,
siteId: this.siteId,
matterName: "%%",
materialName: "%%",
createTimeStart: this.BegindAndEndTime[0],
createTimeEnd: this.BegindAndEndTime[1],
};
if (this.statu && this.statu != 0) {
pramse.type = this.statu;
}
if (this.searchType == 1 && this.searchName) {
pramse.matterName = "%" + this.searchName + "%";
} else if (this.searchName) {
pramse.materialName = "%" + this.searchName + "%";
}
getPrintList(pramse).then((res) => {
const { code, data } = res;
if (code == 1) {
tableData = JSON.parse(JSON.stringify(data.data));
tableData.forEach((item) => {
item.type = item.type == 1 ? "本地打印" : "在线打印";
});
let tableColumns = JSON.parse(JSON.stringify(this.tableHeaders));
let newTableData = tableData.map((item) => {
let obj = {};
for (let key in item) {
obj[key] = item[key];
}
return obj;
});
let exprotExcelName = `${this.nowDay} / ${this.nowTime} / ${
this.$route["meta"]["title"] || "报表信息统计"
}`;
this.exportExcel(tableColumns, newTableData, exprotExcelName);
}
});
} else {
tableData = JSON.parse(JSON.stringify(this.tableSelectedRows));
tableData.forEach((item) => {
item.type = item.type == 1 ? "本地打印" : "在线打印";
});
let tableColumns = JSON.parse(JSON.stringify(this.tableHeaders));
let newTableData = tableData.map((item) => {
let obj = {};
for (let key in item) {
obj[key] = item[key];
}
return obj;
});
let exprotExcelName = `${this.nowDay} / ${this.nowTime} / ${
this.$route["meta"]["title"] || "报表信息统计"
}`;
this.exportExcel(tableColumns, newTableData, exprotExcelName);
}
},
changeStatu(val) { changeStatu(val) {
this.statu = val; this.statu = val;
}, },
changeSearchType(val) { changeSearchType(val) {
this.searchType = val; this.searchType = val;
}, },
handleSearch() {
this.tablePagination.current = 1;
this.tableSelectedKeys = [];
this.tableSelectedRows = [];
this.togetPrintList();
},
togetPrintList() { togetPrintList() {
let pramse = { let pramse = {
page: this.tablePagination.current, page: this.tablePagination.current,
...@@ -312,12 +262,6 @@ export default { ...@@ -312,12 +262,6 @@ export default {
} }
}); });
}, },
rangePickerChange(val) {
this.BegindAndEndTime = [
this.$moment(val[0]).format("YYYY-MM-DD"),
this.$moment(val[1]).format("YYYY-MM-DD"),
];
},
// 重置 // 重置
handleReset() { handleReset() {
this.BegindAndEndTime = [ this.BegindAndEndTime = [
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
> >
<a-icon slot="prefix" type="search" /> <a-icon slot="prefix" type="search" />
</a-input> </a-input>
<a-button type="primary" @click="getDataList">搜索</a-button> <a-button type="primary" @click="handleSearch">搜索</a-button>
<a-button @click="resetBtn">重置</a-button> <a-button @click="resetBtn">重置</a-button>
</a-space> </a-space>
</span> </span>
...@@ -336,6 +336,8 @@ export default { ...@@ -336,6 +336,8 @@ export default {
}, },
//重置按钮 //重置按钮
resetBtn() { resetBtn() {
this.tableSelectedKeys = [];
this.tableSelectedRows = [];
this.tablePagination.current = 1; this.tablePagination.current = 1;
this.searchForm = { this.searchForm = {
id: "", // 排队机id id: "", // 排队机id
...@@ -352,6 +354,13 @@ export default { ...@@ -352,6 +354,13 @@ export default {
this.deviceData = res.data.data; this.deviceData = res.data.data;
}); });
}, },
// 搜索
handleSearch() {
this.tablePagination.current = 1;
this.tableSelectedKeys = [];
this.tableSelectedRows = [];
this.getCallQueListArr();
},
// 获取列表数据 // 获取列表数据
getCallQueListArr() { getCallQueListArr() {
getCallQueList({ getCallQueList({
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
> >
<a-icon slot="prefix" type="search" /> <a-icon slot="prefix" type="search" />
</a-input> </a-input>
<a-button type="primary" @click="getDataList">搜索</a-button> <a-button type="primary" @click="handleSearch">搜索</a-button>
<a-button @click="resetBtn">重置</a-button> <a-button @click="resetBtn">重置</a-button>
</a-space> </a-space>
</span> </span>
...@@ -338,6 +338,8 @@ export default { ...@@ -338,6 +338,8 @@ export default {
//重置按钮 //重置按钮
resetBtn() { resetBtn() {
this.tablePagination.current = 1; this.tablePagination.current = 1;
this.tableSelectedKeys = [];
this.tableSelectedRows = [];
this.searchForm = { this.searchForm = {
id: "", // 排队机id id: "", // 排队机id
style: "", // 状态 style: "", // 状态
...@@ -353,6 +355,13 @@ export default { ...@@ -353,6 +355,13 @@ export default {
this.deviceData = res.data.data; this.deviceData = res.data.data;
}); });
}, },
// 搜索
handleSearch() {
this.tablePagination.current = 1;
this.tableSelectedKeys = [];
this.tableSelectedRows = [];
this.getQueueDataArr();
},
// 获取列表数据 // 获取列表数据
getQueueDataArr() { getQueueDataArr() {
getQueueData({ getQueueData({
......
...@@ -2,54 +2,74 @@ ...@@ -2,54 +2,74 @@
<div class="callRecord-Container"> <div class="callRecord-Container">
<div class="header_box"> <div class="header_box">
<div> <div>
<a-button type="success" @click="toexportTable"> <a-button
:loading="btnLoading"
type="success"
@click="handleExportTable"
>
<span>{{ tableSelectedRows.length ? "导出" : "导出全部" }}</span> <span>{{ tableSelectedRows.length ? "导出" : "导出全部" }}</span>
</a-button> </a-button>
<b>查看样表次数:<i>{{tablePagination.total}}</i></b> <b
<sub>统计时间段:{{BegindAndEndTime[0]}}~{{BegindAndEndTime[1]}} >查看样表次数:<i>{{ tablePagination.total }}</i></b
>
<sub
>统计时间段:{{ BegindAndEndTime[0] }}~{{ BegindAndEndTime[1] }}
</sub> </sub>
</div> </div>
<span> <span>
<!-- <a-input-group compact> --> <a-space>
<a-select :default-value="1" style="width:25%" @change="changeSearchType"> <a-select :default-value="1" @change="changeSearchType">
<a-select-option :value="1"> <a-select-option :value="1"> 按事项 </a-select-option>
按事项 <a-select-option :value="2"> 按材料 </a-select-option>
</a-select-option>
<a-select-option :value="2">
按材料
</a-select-option>
</a-select> </a-select>
<a-input style="width:73%" v-model="searchName" placeholder="请输入评价人姓名或窗口编号搜索"> <a-input v-model="searchName" placeholder="请输入名称搜索">
<a-icon slot="prefix" type="search" /> <a-icon slot="prefix" type="search" />
</a-input> </a-input>
<!-- </a-input-group> --> <!-- </a-input-group> -->
<a-range-picker format="YYYY年MM月DD日" class="range_picker_style" @change="rangePickerChange"> <a-range-picker
v-model="BegindAndEndTime"
format="YYYY-MM-DD"
valueFormat="YYYY-MM-DD"
class="range_picker_style"
>
</a-range-picker> </a-range-picker>
<a-button type="primary" @click="togetBillList">搜索</a-button> <a-button type="primary" @click="handleSearch">搜索</a-button>
<a-button @click="handleReset">重置</a-button>
</a-space>
</span> </span>
</div> </div>
<div class="main"> <div class="main">
<a-table size="small" bordered :row-key="(record) => record.id" :row-selection="{ <a-table
size="small"
bordered
:row-key="(record) => record.id"
:row-selection="{
selectedRowKeys: tableSelectedKeys, selectedRowKeys: tableSelectedKeys,
onChange: onSelectChange, onChange: onSelectChange,
}" :scroll="{ y: 590 }" :pagination="tablePagination" @change="pagTableChange" :loading="tableLoading" }"
:columns="tableHeaders" :dataSource="tableSourceData"> :scroll="{ y: 590 }"
:pagination="tablePagination"
@change="pagTableChange"
:loading="tableLoading"
:columns="tableHeaders"
:dataSource="tableSourceData"
>
<!-- 序号 -->
<span slot="index" slot-scope="text, record, index">{{
(tablePagination.current - 1) * tablePagination.pageSize + index + 1
}}</span>
<template slot="事项名称" slot-scope="text, record, index"> <template slot="事项名称" slot-scope="text, record, index">
<div> <div>
{{record.matterName}} {{ record.matterName }}
</div>
<div class="tabFont">
事项全称:{{record.matterFullName}}
</div> </div>
<div class="tabFont">事项全称:{{ record.matterFullName }}</div>
</template> </template>
<template slot="材料名称" slot-scope="text, record, index"> <template slot="材料名称" slot-scope="text, record, index">
<div> <div>
{{record.materialName}} {{ record.materialName }}
</div>
<div class="tabFont">
样表全称:{{record.materialFullName}}
</div> </div>
<div class="tabFont">样表全称:{{ record.materialFullName }}</div>
</template> </template>
</a-table> </a-table>
</div> </div>
...@@ -59,21 +79,21 @@ ...@@ -59,21 +79,21 @@
<script> <script>
import table from "@/mixins/table"; import table from "@/mixins/table";
import { getBillList } from "@/api/dataAdmin"; import { getBillList } from "@/api/dataAdmin";
import { export2Excel } from "@/utils/js/exportExcel";
export default { export default {
mixins: [table], mixins: [table],
name: "sampleForm", name: "sampleForm",
data() { data() {
return { return {
btnLoading: false,
tableHeaders: [ tableHeaders: [
{ {
title: "序号", title: "序号",
dataIndex: "index",
width: "60px", width: "60px",
key: "index",
align: "center", align: "center",
customRender: (text, record, index) => `${index + 1}`, scopedSlots: {
customRender: "index",
},
}, },
{ {
title: "事项名称", title: "事项名称",
...@@ -94,7 +114,9 @@ export default { ...@@ -94,7 +114,9 @@ export default {
{ {
title: "设备名称", title: "设备名称",
align: "center", align: "center",
dataIndex: "deviceName", customRender: (text) => {
return text.deviceName ? text.deviceName : "--";
},
}, },
{ {
title: "操作时间", title: "操作时间",
...@@ -104,106 +126,80 @@ export default { ...@@ -104,106 +126,80 @@ export default {
{ {
title: "查看时间", title: "查看时间",
align: "center", align: "center",
dataIndex: "查看时间", customRender: (text) => {
return text.operTime ? text.operTime : "--";
},
}, },
], ],
BegindAndEndTime: [],//时间段 BegindAndEndTime: [
this.$moment(new Date()).format("YYYY-MM-DD"),
this.$moment(new Date()).format("YYYY-MM-DD"),
], //时间段
searchName: undefined, searchName: undefined,
searchType:1, searchType: 1,
siteId:undefined, siteId: localStorage.getItem("siteId"),
tableSelectedKeys: [],
tableSelectedRows: [],
tHeader: [
// 导出的表头名信息
"事项简称",
"事项全称",
"材料简称",
"材料全称",
"设备名称",
"操作时间",
"查看时间",
],
filterVal: [
// 导出的表头字段名,需要导出表格字段名
"matterName",
"matterFullName",
"materialName",
"materialFullName",
"deviceName",
"createTime",
"operTime",
],
}; };
}, },
components: { components: {},
},
mounted() { mounted() {
this.setMoment(); this.setMoment();
this.BegindAndEndTime=[this.$moment(new Date()).format("YYYY-MM-DD"),this.$moment(new Date()).format("YYYY-MM-DD")] this.togetBillList();
this.siteId = localStorage.getItem('siteId')
this.togetBillList()
}, },
methods: { methods: {
//导出 handleSearch() {
toexportTable() { this.tablePagination.current = 1;
let tableData = []; this.tableSelectedKeys = [];
if (this.tableSelectedRows.length == 0) { this.tableSelectedRows = [];
this.togetBillList();
let pramse = {
page:1,
size:-1,
siteId:this.siteId,
matterName:"%%",
materialName:"%%",
operTimeStart:this.BegindAndEndTime[0],
operTimeEnd:this.BegindAndEndTime[1]
}
if(this.searchType==1 && this.searchName){
pramse.matterName = '%'+this.searchName+'%'
}else if(this.searchName){
pramse.materialName='%'+this.searchName+'%'
}
getBillList(pramse).then((res)=>{
const{code,data} = res;
if(code == 1){
tableData = JSON.parse(JSON.stringify(data.data));
let tableColumns = JSON.parse(JSON.stringify(this.tableHeaders));
let newTableData = tableData.map(item => {
let obj = {};
for (let key in item) {
obj[key] = item[key];
}
return obj;
})
let exprotExcelName = `${this.nowDay} / ${this.nowTime} / ${this.$route['meta']['title'] || '报表信息统计'}`;
this.exportExcel(tableColumns, newTableData, exprotExcelName);
}
})
} else {
tableData = JSON.parse(JSON.stringify(this.tableSelectedRows));
let tableColumns = JSON.parse(JSON.stringify(this.tableHeaders));
let newTableData = tableData.map(item => {
let obj = {};
for (let key in item) {
obj[key] = item[key];
}
return obj;
})
let exprotExcelName = `${this.nowDay} / ${this.nowTime} / ${this.$route['meta']['title'] || '报表信息统计'}`;
this.exportExcel(tableColumns, newTableData, exprotExcelName);
}
}, },
togetBillList() {
togetBillList(){
let pramse = { let pramse = {
page:this.tablePagination.current, page: this.tablePagination.current,
size:this.tablePagination.pageSize, size: this.tablePagination.pageSize,
siteId:this.siteId, siteId: this.siteId,
matterName:"%%", matterName: "%%",
materialName:"%%", materialName: "%%",
operTimeStart:this.BegindAndEndTime[0], operTimeStart: this.BegindAndEndTime[0],
operTimeEnd:this.BegindAndEndTime[1] operTimeEnd: this.BegindAndEndTime[1],
} };
if(this.searchType==1 && this.searchName){ if (this.searchType == 1 && this.searchName) {
pramse.matterName = '%'+this.searchName+'%' pramse.matterName = "%" + this.searchName + "%";
}else if(this.searchName){ } else if (this.searchName) {
pramse.materialName='%'+this.searchName+'%' pramse.materialName = "%" + this.searchName + "%";
} }
getBillList(pramse).then((res)=>{ getBillList(pramse).then((res) => {
const{code,data} = res; const { code, data } = res;
if(code==1){ if (code == 1) {
this.tableSourceData = data.data this.tableSourceData = data.data;
this.tablePagination.total = data.total this.tablePagination.total = data.total;
} }
}) });
},
changeSearchType(val){
this.searchType = val
}, },
rangePickerChange(val) { changeSearchType(val) {
this.BegindAndEndTime=[this.$moment(val[0]).format("YYYY-MM-DD"),this.$moment(val[1]).format("YYYY-MM-DD")] this.searchType = val;
}, },
QueueState(type) { QueueState(type) {
switch (type) { switch (type) {
case 0: case 0:
...@@ -215,7 +211,71 @@ export default { ...@@ -215,7 +211,71 @@ export default {
return "type0"; return "type0";
} }
}, },
// 重置
handleReset() {
this.BegindAndEndTime = [
this.$moment(new Date()).format("YYYY-MM-DD"),
this.$moment(new Date()).format("YYYY-MM-DD"),
];
this.searchName = undefined;
this.searchType = 1;
this.tablePagination.current = 1;
this.tableSelectedKeys = [];
this.tableSelectedRows = [];
this.togetBillList();
},
// 选中
onSelectChange(keys, rows) {
this.tableSelectedKeys = keys;
const res = new Map();
this.tableSelectedRows = [...this.tableSelectedRows, ...rows]
.filter((v) => {
return !res.has(v.id) && res.set(v.id, 1);
})
.filter((v) => {
return this.tableSelectedKeys.some((val) => v.id == val);
});
},
// 导出
handleExportTable() {
this.btnLoading = true;
if (this.tableSelectedKeys.length && this.tableSelectedRows.length) {
export2Excel(
this.tHeader,
this.filterVal,
this.tableSelectedRows,
"样表记录报表" + this.$moment().format("YYYYMMDDHHmmss")
);
} else {
let pramse = {
page: 1,
size: -1,
siteId: this.siteId,
matterName: "%%",
materialName: "%%",
operTimeStart: this.BegindAndEndTime[0],
operTimeEnd: this.BegindAndEndTime[1],
};
if (this.searchType == 1 && this.searchName) {
pramse.matterName = "%" + this.searchName + "%";
} else if (this.searchName) {
pramse.materialName = "%" + this.searchName + "%";
}
getBillList(pramse).then((res) => {
const { code, data } = res;
if (code == 1) {
if (!data.data.length) return;
export2Excel(
this.tHeader,
this.filterVal,
data.data,
"样表记录报表" + this.$moment().format("YYYYMMDDHHmmss")
);
}
});
}
this.btnLoading = false;
},
}, },
}; };
</script> </script>
...@@ -231,7 +291,7 @@ export default { ...@@ -231,7 +291,7 @@ export default {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
&>div { & > div {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
......
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