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

pref:修改报表

parent 0b36eb6d
......@@ -2,7 +2,11 @@
<div class="callRecord-Container">
<div class="header_box">
<div>
<a-button type="success" @click="handleExportTable">
<a-button
:loading="btnLoading"
type="success"
@click="handleExportTable"
>
<span>{{ tableSelectedRows.length ? "导出" : "导出全部" }}</span>
</a-button>
<b
......@@ -34,13 +38,13 @@
<!-- </a-input-group> -->
<a-range-picker
format="YYYY年MM月DD日"
valueFormat="YYYY-MM-DD"
class="range_picker_style"
v-model="BegindAndEndTime"
@change="rangePickerChange"
>
</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-space>
</span>
......@@ -97,6 +101,7 @@ export default {
name: "fillForm",
data() {
return {
btnLoading: false,
tableHeaders: [
{
title: "序号",
......@@ -198,7 +203,7 @@ export default {
"matterName",
"matterFullName",
"materialName",
"materiaFullName",
"materialFullName",
"idName",
"idCard",
"mobile",
......@@ -219,73 +224,18 @@ export default {
},
},
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) {
this.statu = val;
},
changeSearchType(val) {
this.searchType = val;
},
handleSearch() {
this.tablePagination.current = 1;
this.tableSelectedKeys = [];
this.tableSelectedRows = [];
this.togetPrintList();
},
togetPrintList() {
let pramse = {
page: this.tablePagination.current,
......@@ -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() {
this.BegindAndEndTime = [
......
......@@ -40,7 +40,7 @@
>
<a-icon slot="prefix" type="search" />
</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-space>
</span>
......@@ -336,6 +336,8 @@ export default {
},
//重置按钮
resetBtn() {
this.tableSelectedKeys = [];
this.tableSelectedRows = [];
this.tablePagination.current = 1;
this.searchForm = {
id: "", // 排队机id
......@@ -352,6 +354,13 @@ export default {
this.deviceData = res.data.data;
});
},
// 搜索
handleSearch() {
this.tablePagination.current = 1;
this.tableSelectedKeys = [];
this.tableSelectedRows = [];
this.getCallQueListArr();
},
// 获取列表数据
getCallQueListArr() {
getCallQueList({
......
......@@ -40,7 +40,7 @@
>
<a-icon slot="prefix" type="search" />
</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-space>
</span>
......@@ -338,6 +338,8 @@ export default {
//重置按钮
resetBtn() {
this.tablePagination.current = 1;
this.tableSelectedKeys = [];
this.tableSelectedRows = [];
this.searchForm = {
id: "", // 排队机id
style: "", // 状态
......@@ -353,6 +355,13 @@ export default {
this.deviceData = res.data.data;
});
},
// 搜索
handleSearch() {
this.tablePagination.current = 1;
this.tableSelectedKeys = [];
this.tableSelectedRows = [];
this.getQueueDataArr();
},
// 获取列表数据
getQueueDataArr() {
getQueueData({
......
<template>
<div class="callRecord-Container">
<div class="header_box">
<div>
<a-button type="success" @click="toexportTable">
<span>{{ tableSelectedRows.length ? "导出" : "导出全部" }}</span>
</a-button>
<b>查看样表次数:<i>{{tablePagination.total}}</i></b>
<sub>统计时间段:{{BegindAndEndTime[0]}}~{{BegindAndEndTime[1]}}
</sub>
</div>
<span>
<!-- <a-input-group compact> -->
<a-select :default-value="1" style="width:25%" @change="changeSearchType">
<a-select-option :value="1">
按事项
</a-select-option>
<a-select-option :value="2">
按材料
</a-select-option>
</a-select>
<a-input style="width:73%" v-model="searchName" placeholder="请输入评价人姓名或窗口编号搜索">
<a-icon slot="prefix" type="search" />
</a-input>
<!-- </a-input-group> -->
<a-range-picker format="YYYY年MM月DD日" class="range_picker_style" @change="rangePickerChange">
</a-range-picker>
<div class="callRecord-Container">
<div class="header_box">
<div>
<a-button
:loading="btnLoading"
type="success"
@click="handleExportTable"
>
<span>{{ tableSelectedRows.length ? "导出" : "导出全部" }}</span>
</a-button>
<b
>查看样表次数:<i>{{ tablePagination.total }}</i></b
>
<sub
>统计时间段:{{ BegindAndEndTime[0] }}~{{ BegindAndEndTime[1] }}
</sub>
</div>
<span>
<a-space>
<a-select :default-value="1" @change="changeSearchType">
<a-select-option :value="1"> 按事项 </a-select-option>
<a-select-option :value="2"> 按材料 </a-select-option>
</a-select>
<a-input v-model="searchName" placeholder="请输入名称搜索">
<a-icon slot="prefix" type="search" />
</a-input>
<!-- </a-input-group> -->
<a-range-picker
v-model="BegindAndEndTime"
format="YYYY-MM-DD"
valueFormat="YYYY-MM-DD"
class="range_picker_style"
>
</a-range-picker>
<a-button type="primary" @click="togetBillList">搜索</a-button>
</span>
</div>
<div class="main">
<a-table size="small" bordered :row-key="(record) => record.id" :row-selection="{
selectedRowKeys: tableSelectedKeys,
onChange: onSelectChange,
}" :scroll="{ y: 590 }" :pagination="tablePagination" @change="pagTableChange" :loading="tableLoading"
:columns="tableHeaders" :dataSource="tableSourceData">
<template slot="事项名称" slot-scope="text, record, index">
<div>
{{record.matterName}}
</div>
<div class="tabFont">
事项全称:{{record.matterFullName}}
</div>
</template>
<template slot="材料名称" slot-scope="text, record, index">
<div>
{{record.materialName}}
</div>
<div class="tabFont">
样表全称:{{record.materialFullName}}
</div>
</template>
</a-table>
</div>
<a-button type="primary" @click="handleSearch">搜索</a-button>
<a-button @click="handleReset">重置</a-button>
</a-space>
</span>
</div>
<div class="main">
<a-table
size="small"
bordered
:row-key="(record) => record.id"
:row-selection="{
selectedRowKeys: tableSelectedKeys,
onChange: onSelectChange,
}"
: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">
<div>
{{ record.matterName }}
</div>
<div class="tabFont">事项全称:{{ record.matterFullName }}</div>
</template>
<template slot="材料名称" slot-scope="text, record, index">
<div>
{{ record.materialName }}
</div>
<div class="tabFont">样表全称:{{ record.materialFullName }}</div>
</template>
</a-table>
</div>
</div>
</template>
<script>
import table from "@/mixins/table";
import { getBillList } from "@/api/dataAdmin";
import { export2Excel } from "@/utils/js/exportExcel";
export default {
mixins: [table],
name: "sampleForm",
data() {
return {
tableHeaders: [
{
title: "序号",
dataIndex: "index",
width: "60px",
key: "index",
align: "center",
customRender: (text, record, index) => `${index + 1}`,
},
{
title: "事项名称",
align: "center",
dataIndex: "matterName",
scopedSlots: {
customRender: "事项名称",
},
},
{
title: "材料名称",
align: "center",
dataIndex: "materialName",
scopedSlots: {
customRender: "材料名称",
},
},
{
title: "设备名称",
align: "center",
dataIndex: "deviceName",
},
{
title: "操作时间",
align: "center",
dataIndex: "operTime",
},
{
title: "查看时间",
align: "center",
dataIndex: "查看时间",
},
],
BegindAndEndTime: [],//时间段
searchName: undefined,
searchType:1,
siteId:undefined,
};
},
components: {
},
mounted() {
this.setMoment();
this.BegindAndEndTime=[this.$moment(new Date()).format("YYYY-MM-DD"),this.$moment(new Date()).format("YYYY-MM-DD")]
this.siteId = localStorage.getItem('siteId')
this.togetBillList()
},
methods: {
//导出
toexportTable() {
let tableData = [];
if (this.tableSelectedRows.length == 0) {
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);
}
mixins: [table],
name: "sampleForm",
data() {
return {
btnLoading: false,
tableHeaders: [
{
title: "序号",
width: "60px",
align: "center",
scopedSlots: {
customRender: "index",
},
},
togetBillList(){
let pramse = {
page:this.tablePagination.current,
size:this.tablePagination.pageSize,
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){
this.tableSourceData = data.data
this.tablePagination.total = data.total
}
})
{
title: "事项名称",
align: "center",
dataIndex: "matterName",
scopedSlots: {
customRender: "事项名称",
},
},
changeSearchType(val){
this.searchType = val
{
title: "材料名称",
align: "center",
dataIndex: "materialName",
scopedSlots: {
customRender: "材料名称",
},
},
rangePickerChange(val) {
this.BegindAndEndTime=[this.$moment(val[0]).format("YYYY-MM-DD"),this.$moment(val[1]).format("YYYY-MM-DD")]
{
title: "设备名称",
align: "center",
customRender: (text) => {
return text.deviceName ? text.deviceName : "--";
},
},
QueueState(type) {
switch (type) {
case 0:
return "type1";
case 1:
return "type2";
default:
return "type0";
}
{
title: "操作时间",
align: "center",
dataIndex: "operTime",
},
{
title: "查看时间",
align: "center",
customRender: (text) => {
return text.operTime ? text.operTime : "--";
},
},
],
BegindAndEndTime: [
this.$moment(new Date()).format("YYYY-MM-DD"),
this.$moment(new Date()).format("YYYY-MM-DD"),
], //时间段
searchName: undefined,
searchType: 1,
siteId: localStorage.getItem("siteId"),
tableSelectedKeys: [],
tableSelectedRows: [],
tHeader: [
// 导出的表头名信息
"事项简称",
"事项全称",
"材料简称",
"材料全称",
"设备名称",
"操作时间",
"查看时间",
],
filterVal: [
// 导出的表头字段名,需要导出表格字段名
"matterName",
"matterFullName",
"materialName",
"materialFullName",
"deviceName",
"createTime",
"operTime",
],
};
},
components: {},
mounted() {
this.setMoment();
this.togetBillList();
},
methods: {
handleSearch() {
this.tablePagination.current = 1;
this.tableSelectedKeys = [];
this.tableSelectedRows = [];
this.togetBillList();
},
togetBillList() {
let pramse = {
page: this.tablePagination.current,
size: this.tablePagination.pageSize,
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) {
this.tableSourceData = data.data;
this.tablePagination.total = data.total;
}
});
},
changeSearchType(val) {
this.searchType = val;
},
QueueState(type) {
switch (type) {
case 0:
return "type1";
case 1:
return "type2";
default:
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>
<style lang="less" scoped>
/deep/.ant-spin-container {
display: block;
display: block;
}
.header_box {
padding-bottom: 1rem;
padding-bottom: 1rem;
display: flex;
justify-content: space-between;
align-items: center;
& > div {
display: flex;
justify-content: space-between;
justify-content: flex-start;
align-items: center;
&>div {
display: flex;
justify-content: flex-start;
align-items: center;
b {
font-style: normal;
font-weight: unset;
font-size: 16px;
margin-left: 20px;
b {
font-style: normal;
font-weight: unset;
font-size: 16px;
margin-left: 20px;
i {
color: #0595fd;
font-style: normal;
}
}
i {
color: #0595fd;
font-style: normal;
}
}
sub {
font-size: 14px;
font-style: normal;
bottom: unset;
margin-left: 20px;
}
sub {
font-size: 14px;
font-style: normal;
bottom: unset;
margin-left: 20px;
}
}
}
.tabFont {
font-size: 12px;
font-weight: 300;
font-size: 12px;
font-weight: 300;
}
</style>
......
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