13 changed files with 1237 additions and 644 deletions
-
7src/api/report/com_add_customer_report.js
-
14src/api/report/com_edit_customer_report_search_column.js
-
5src/api/report/com_run_customer_report.js
-
11src/api/report/com_show_customer_report_search_column.js
-
11src/api/report/com_update_customer_report.js
-
4src/api/report/report_manage.js
-
27src/assets/scss/global.scss
-
151src/views/modules/report/com_add_customer_report.vue
-
337src/views/modules/report/com_edit_customer_report_search_column.vue
-
126src/views/modules/report/com_run_customer_report.vue
-
239src/views/modules/report/com_show_customer_report_search_column.vue
-
152src/views/modules/report/com_update_customer_report.vue
-
797src/views/modules/report/report_manage.vue
@ -0,0 +1,7 @@ |
|||||
|
import { createAPI } from '@/utils/httpRequest.js' |
||||
|
|
||||
|
// 获取派工单的最新信息
|
||||
|
export const getReportTypeList = data => createAPI('report/getReportTypeList', 'POST', data) |
||||
|
|
||||
|
// 保存定制的报表功能
|
||||
|
export const addCustomerReport = data => createAPI('report/addCustomerReport', 'POST', data) |
||||
@ -0,0 +1,14 @@ |
|||||
|
import { createAPI } from '@/utils/httpRequest.js' |
||||
|
|
||||
|
// 获取查询列
|
||||
|
export const getSearchColumns = data => createAPI('report/getSearchColumnsByReportId', 'POST', data) |
||||
|
|
||||
|
// 获取派工单的最新信息
|
||||
|
export const getReportTypeList = data => createAPI('report/getReportTypeList', 'POST', data) |
||||
|
|
||||
|
// 自动处理sql的查询列
|
||||
|
export const autoProcessSearchColumn = data => createAPI('report/autoProcessSearchColumn', 'POST', data) |
||||
|
|
||||
|
// 保存定制的报表功能
|
||||
|
export const saveCustomerSearchColumns = data => createAPI('report/saveCustomerSearchColumns', 'POST', data) |
||||
|
|
||||
@ -0,0 +1,5 @@ |
|||||
|
import { createAPI } from '@/utils/httpRequest.js' |
||||
|
|
||||
|
// 获取派工单的最新信息
|
||||
|
export const runCustomerReport = data => createAPI('report/runCustomerReport', 'POST', data) |
||||
|
|
||||
@ -0,0 +1,11 @@ |
|||||
|
import { createAPI } from '@/utils/httpRequest.js' |
||||
|
|
||||
|
// 获取查询列
|
||||
|
export const getSearchColumns = data => createAPI('report/getSearchColumnsByReportId', 'POST', data) |
||||
|
|
||||
|
// 自动处理sql的查询列
|
||||
|
export const autoProcessSearchColumn = data => createAPI('report/autoProcessSearchColumn', 'POST', data) |
||||
|
|
||||
|
// 保存定制的报表功能
|
||||
|
export const saveCustomerSearchColumns = data => createAPI('report/saveCustomerSearchColumns', 'POST', data) |
||||
|
|
||||
@ -0,0 +1,11 @@ |
|||||
|
import { createAPI } from '@/utils/httpRequest.js' |
||||
|
|
||||
|
// 获取派工单的最新信息
|
||||
|
export const getReportTypeList = data => createAPI('report/getReportTypeList', 'POST', data) |
||||
|
|
||||
|
// 查询定制的报表功能
|
||||
|
export const getCustomerReportByReportId = data => createAPI('report/getCustomerReportByReportId', 'POST', data) |
||||
|
|
||||
|
// 保存定制的报表功能
|
||||
|
export const saveCustomerReport = data => createAPI('report/saveCustomerReport', 'POST', data) |
||||
|
|
||||
@ -1,7 +1,7 @@ |
|||||
import { createAPI } from '@/utils/httpRequest.js' |
import { createAPI } from '@/utils/httpRequest.js' |
||||
|
|
||||
// 获取派工单的最新信息
|
// 获取派工单的最新信息
|
||||
export const getReportTypeList = data => createAPI('scheduling/getReportTypeList', 'POST', data) |
|
||||
|
export const getReportTypeList = data => createAPI('report/getReportTypeList', 'POST', data) |
||||
|
|
||||
// 获取派工单的最新信息
|
// 获取派工单的最新信息
|
||||
export const getCurrentPageTables = data => createAPI('scheduling/getCustomerReportList', 'POST', data) |
|
||||
|
export const getCurrentPageTables = data => createAPI('report/getCustomerReportList', 'POST', data) |
||||
@ -0,0 +1,151 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" |
||||
|
width="580px" style="height: 600px;" class="customer-dialog"> |
||||
|
<el-form :inline="true" label-position="top" style="height: 320px;" |
||||
|
label-width="80px"> |
||||
|
<!-- 信息 --> |
||||
|
<el-row> |
||||
|
<el-col :span="18"> |
||||
|
<el-form-item :label="'报表名称:'" > |
||||
|
<el-input v-model="pageData.reportName" ref="reportName" style="width: 450px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item :label="'报表分类:'" style="margin-left: 60px;"> |
||||
|
<el-select v-model="pageData.reportType" style="width: 80px"> |
||||
|
<el-option |
||||
|
v-for="(item, index) in reportTypeList" |
||||
|
:key="index" |
||||
|
:label="item.baseData" |
||||
|
:value="item.baseData"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item :label="'备注:'" > |
||||
|
<el-input v-model="pageData.reportRemark" style="width: 560px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24" > |
||||
|
<el-form-item :label="'SQL语句:'" > |
||||
|
<el-input type="textarea" class="customer-textarea" style="width: 560px;" ref="reportSql" v-model="pageData.reportSql" :rows="10" :cols="85"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<span slot="footer" class="dialog-footer" style="margin-top: -20px;"> |
||||
|
<el-button type="primary" @click="addCustomerReportBun">保存</el-button> |
||||
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getReportTypeList, |
||||
|
addCustomerReport, |
||||
|
} from '@/api/report/com_add_customer_report.js' |
||||
|
export default { |
||||
|
name: "com_exception_reason", |
||||
|
data() { |
||||
|
return { |
||||
|
titleCon: '报表自定义-新增', |
||||
|
reportTypeList: [], |
||||
|
pageData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: this.$store.state.user.name, |
||||
|
reportName: '', |
||||
|
reportRemark: '', |
||||
|
reportType: '', |
||||
|
reportSql: '', |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
/*初始化页面参数*/ |
||||
|
init() { |
||||
|
//清空参数 |
||||
|
this.pageData.reportId = ''; |
||||
|
this.pageData.reportName = ''; |
||||
|
this.pageData.reportRemark = ''; |
||||
|
this.pageData.reportSql = ''; |
||||
|
//自动获取焦点 |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.reportName.focus(); |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
/*关闭modal*/ |
||||
|
closeDialog(){ |
||||
|
this.$emit('update:visible', false); |
||||
|
//刷新源页面的数据 |
||||
|
this.$emit('refreshCurrentPage'); |
||||
|
}, |
||||
|
|
||||
|
/*刷新报工的类型*/ |
||||
|
refreshReportType(){ |
||||
|
let requestData = {type: 'report_type', secondType: 'select'}; |
||||
|
getReportTypeList(requestData).then(({data}) => { |
||||
|
this.reportTypeList = data.rows; |
||||
|
//删除ALL的选项 |
||||
|
this.pageData.reportType = data.rows[0].baseData; |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/*添加异常原因的数据*/ |
||||
|
addCustomerReportBun(){ |
||||
|
//判断是否操作 是否保存了名称和sql语句 |
||||
|
let reportName = this.pageData.reportName.trim(); |
||||
|
let reportSql = this.pageData.reportSql.trim(); |
||||
|
if(null == reportName || '' === reportName){ |
||||
|
this.$message.error('请输入报表的名称!') |
||||
|
return false; |
||||
|
} |
||||
|
if(null == reportSql || '' === reportSql){ |
||||
|
this.$message.error('请输入报表的SQL语句!') |
||||
|
return false; |
||||
|
} |
||||
|
//重置参数 |
||||
|
this.pageData.reportName = reportName; |
||||
|
this.pageData.reportSql = reportSql; |
||||
|
//调用保存的方法 |
||||
|
addCustomerReport(this.pageData).then(({data}) => { |
||||
|
//判断是否保存成功 |
||||
|
if(data.code == 200){ |
||||
|
this.$message.success(data.msg) |
||||
|
//关闭dialog |
||||
|
this.closeDialog(); |
||||
|
}else{ |
||||
|
this.$message.error(data.msg); |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
editSearchColumnModal(){ |
||||
|
//关闭当前的组件 |
||||
|
this.closeDialog(); |
||||
|
//处理结束卷组件的方法 |
||||
|
this.$emit('initExceptionReason', this.pageData.exceptionReason); |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
created() { |
||||
|
//查询报表的类型 |
||||
|
this.refreshReportType(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,337 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" |
||||
|
width="850px" style="height: 490px;" class="customer-dialog"> |
||||
|
<el-form :inline="true" label-position="top" style="height: 320px;" |
||||
|
label-width="80px"> |
||||
|
<!-- 菜单信息 --> |
||||
|
<el-row style="margin-top: -20px;"> |
||||
|
<el-col :span="4"> |
||||
|
<el-form-item class="customer-button"> |
||||
|
<el-button @click="" type="primary" style="margin-left: 10px; margin-bottom: 5px;"> |
||||
|
新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="4"> |
||||
|
<el-form-item class="customer-button"> |
||||
|
<el-button @click="autoProcessSearchColumnBun" type="primary" style="margin-left: 10px; margin-bottom: 5px;"> |
||||
|
自动获取</el-button> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="4"> |
||||
|
<el-form-item class="customer-button"> |
||||
|
<el-button type="primary" @click="refreshPageData" style="margin-left: 10px; margin-bottom: 5px;"> |
||||
|
刷新</el-button> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<!-- 主材料 --> |
||||
|
<el-form> |
||||
|
<fieldset class="customer-fieldset" style="width: 830px;"> |
||||
|
<legend>查询列</legend> |
||||
|
<el-table height="240" |
||||
|
:cell-style="customerCellStyle" :cell-class-name="customerCellClassName" |
||||
|
:data="searchColumnList" |
||||
|
border |
||||
|
v-loading="dataListLoading" |
||||
|
style="width: 100%; margin-top: -5px;"> |
||||
|
<el-table-column |
||||
|
fixed="left" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
width="115" |
||||
|
:label="'操作'"> |
||||
|
<template slot-scope="scope"> |
||||
|
<a class="customer-a" @click="warnReopenSfdcRollsConfirm(scope.row)">删除</a> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in columnSearchColumnlArray" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed" |
||||
|
:width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input type="number" class="table-number-input" v-if="item.columnAttr === 'number'" |
||||
|
v-model="scope.row[item.columnProp]"></el-input> |
||||
|
<el-input type="text" class="table-text-input" v-if="item.columnAttr === 'text'" |
||||
|
v-model="scope.row[item.columnProp]"></el-input> |
||||
|
<el-select v-model="scope.row[item.columnProp]" class="table-select-input" v-if="item.columnAttr === 'select'"> |
||||
|
<el-option v-for="(item, index) in columnTypeList" :key="index" :label="item.columnType" :value="item.columnType"> |
||||
|
|
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
<span v-else>{{scope.row[item.columnProp]}}</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
||||
|
style="width: 100px; height: 80px"/></span> |
||||
|
|
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</fieldset> |
||||
|
</el-form> |
||||
|
</el-form> |
||||
|
<span slot="footer" class="dialog-footer" style="margin-top: 0px;"> |
||||
|
<el-button type="primary" @click="saveCustomerReportSearchColumns">保存</el-button> |
||||
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getSearchColumns, |
||||
|
getReportTypeList, |
||||
|
autoProcessSearchColumn, |
||||
|
saveCustomerSearchColumns, |
||||
|
} from '@/api/report/com_edit_customer_report_search_column.js'; |
||||
|
export default { |
||||
|
name: "com_finish_roll", |
||||
|
data() { |
||||
|
return { |
||||
|
titleCon: '查询列维护', |
||||
|
reportTypeList: [], |
||||
|
columnTypeList:[ |
||||
|
{columnType: '文本'}, |
||||
|
{columnType: '数字'}, |
||||
|
], |
||||
|
pageData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: this.$store.state.user.name, |
||||
|
reportId: '', |
||||
|
}, |
||||
|
searchColumnList: [], |
||||
|
columnSearchColumnlArray: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5307, |
||||
|
serialNumber: '5307CustomerColumnField', |
||||
|
tableId: "5307Customer", |
||||
|
tableName: "查询列", |
||||
|
columnProp: "columnField", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "参数ID", |
||||
|
columnWidth: '', |
||||
|
columnHidden: false, |
||||
|
columnAttr: 'ori', |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5307, |
||||
|
serialNumber: '5307CustomerColumnName', |
||||
|
tableId: "5307Customer", |
||||
|
tableName: "查询列", |
||||
|
columnProp: "columnName", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "参数名称", |
||||
|
columnWidth: '', |
||||
|
columnHidden: false, |
||||
|
columnAttr: 'text', |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5307, |
||||
|
serialNumber: '5307CustomerColumnType', |
||||
|
tableId: "5307Customer", |
||||
|
tableName: "查询列", |
||||
|
columnProp: "columnType", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "参数类型", |
||||
|
columnWidth: '', |
||||
|
columnHidden: false, |
||||
|
columnAttr: 'select', |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5307, |
||||
|
serialNumber: '5307CustomerColumnDefaultValue', |
||||
|
tableId: "5307Customer", |
||||
|
tableName: "查询列", |
||||
|
columnProp: "columnDefaultValue", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "参数默认值", |
||||
|
columnWidth: '', |
||||
|
columnHidden: false, |
||||
|
columnAttr: 'text', |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5307, |
||||
|
serialNumber: '5307CustomerSortNo', |
||||
|
tableId: "5307Customer", |
||||
|
tableName: "查询列", |
||||
|
columnProp: "sortNo", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "显示顺序", |
||||
|
columnWidth: '', |
||||
|
columnHidden: false, |
||||
|
columnAttr: 'number', |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5307, |
||||
|
serialNumber: '5307CustomerColumnRemark', |
||||
|
tableId: "5307Customer", |
||||
|
tableName: "查询列", |
||||
|
columnProp: "columnRemark", |
||||
|
headerAlign: "center", |
||||
|
align: "right", |
||||
|
columnLabel: "备注", |
||||
|
columnWidth: '', |
||||
|
columnHidden: false, |
||||
|
columnAttr: 'text', |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
], |
||||
|
dataListLoading: false, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
/*初始化页面参数*/ |
||||
|
init(reportId) { |
||||
|
//设置参数 |
||||
|
this.pageData.reportId = reportId; |
||||
|
//刷新页面的参数 |
||||
|
this.refreshPageData(); |
||||
|
}, |
||||
|
|
||||
|
/*关闭modal*/ |
||||
|
closeDialog(){ |
||||
|
this.$emit('update:visible', false); |
||||
|
}, |
||||
|
|
||||
|
/*刷新当前的页面参数*/ |
||||
|
refreshPageData(){ |
||||
|
//刷新材料的数据 |
||||
|
this.refreshSearchColumnTable(); |
||||
|
}, |
||||
|
|
||||
|
/*刷新报工的类型*/ |
||||
|
refreshReportType(){ |
||||
|
let requestData = {'type': 'report_type', 'secondType': 'select'}; |
||||
|
getReportTypeList(requestData).then(({data}) => { |
||||
|
this.reportTypeList = data.rows; |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
//刷新当前卷的时间数据 |
||||
|
refreshSearchColumnTable(){ |
||||
|
getSearchColumns(this.pageData).then(({data}) => { |
||||
|
this.searchColumnList = data.rows; |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
/*添加定制的css类*/ |
||||
|
customerCellClassName({row, column, rowIndex, columnIndex}) { |
||||
|
if(column.property === 'sortNo'){ |
||||
|
return 'customer-number-cell'; |
||||
|
}else if(columnIndex >= 2 && column.property === 'reportType'){ |
||||
|
return 'customer-select-cell'; |
||||
|
}else if(columnIndex >= 2){ |
||||
|
return 'customer-text-cell'; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/*添加定制的cess样式*/ |
||||
|
customerCellStyle({row, column, rowIndex, columnIndex}) { |
||||
|
if(columnIndex >= 2){ |
||||
|
return 'padding: 0px 0px;'; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/*自动获取列*/ |
||||
|
autoProcessSearchColumnBun(){ |
||||
|
autoProcessSearchColumn(this.pageData).then(({data}) => { |
||||
|
//判断是否成功 |
||||
|
if(data.code == 200){ |
||||
|
this.$message.success(data.msg); |
||||
|
//刷新列表 |
||||
|
this.refreshSearchColumnTable(); |
||||
|
}else{ |
||||
|
this.$message.error(data.msg); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
/*保存已经修改好的参数数据*/ |
||||
|
saveCustomerReportSearchColumns(){ |
||||
|
//组装数据 |
||||
|
let requestData = {searchColumnList: JSON.stringify(this.searchColumnList), pageData: JSON.stringify(this.pageData)}; |
||||
|
saveCustomerSearchColumns(requestData).then(({data}) => { |
||||
|
//判断是否成功 |
||||
|
if(data.code == 200){ |
||||
|
this.closeDialog(); |
||||
|
}else{ |
||||
|
this.$message.error(data.msg); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
created() { |
||||
|
//查询报表的类型 |
||||
|
this.refreshReportType(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
/*调节页面button和input的上下间距*/ |
||||
|
.customer-css .customer-button{ |
||||
|
margin-top: 25px; |
||||
|
} |
||||
|
|
||||
|
/*调节样式*/ |
||||
|
.customer-item{ |
||||
|
margin-top: -10px; |
||||
|
} |
||||
|
/*fieldset下table的样式*/ |
||||
|
.customer-fieldset /deep/ .el-table__header th.is-leaf{ |
||||
|
line-height: 16px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .customer-tab .el-tabs__content{ |
||||
|
padding: 0px !important; |
||||
|
} |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,126 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" |
||||
|
width="1200px" style="height: 590px;" class="customer-dialog"> |
||||
|
<el-form :inline="true" label-position="top" style="height: 360px;" |
||||
|
label-width="80px"> |
||||
|
<!-- 定制报表查询 --> |
||||
|
<el-form> |
||||
|
<el-table height="340" |
||||
|
:data="customerReportList" |
||||
|
border |
||||
|
v-loading="dataListLoading" |
||||
|
style="width: 100%; margin-top: 0px;"> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in customerColumnlArray" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed" |
||||
|
:width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input type="number" class="table-number-input" v-if="item.columnAttr === 'number'" |
||||
|
v-model="scope.row[item.columnProp]"></el-input> |
||||
|
<el-input type="text" class="table-text-input" v-if="item.columnAttr === 'text'" |
||||
|
v-model="scope.row[item.columnProp]"></el-input> |
||||
|
<span v-else>{{scope.row[item.columnProp]}}</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
||||
|
style="width: 100px; height: 80px"/></span> |
||||
|
|
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-form> |
||||
|
</el-form> |
||||
|
<span slot="footer" class="dialog-footer" style="margin-top: 0px;"> |
||||
|
<el-button type="primary" @click="runCustomerReportData">刷新</el-button> |
||||
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
runCustomerReport, |
||||
|
} from '@/api/report/com_run_customer_report.js'; |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
titleCon: '定制报表查询', |
||||
|
pageData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: this.$store.state.user.name, |
||||
|
reportId: '', |
||||
|
}, |
||||
|
customerReportList: [], |
||||
|
customerColumnlArray: [], |
||||
|
searchColumnData: [], |
||||
|
dataListLoading: false, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
/*初始化页面参数*/ |
||||
|
init(reportId, searchColumns) { |
||||
|
//设置参数 |
||||
|
this.pageData.reportId = reportId; |
||||
|
this.searchColumnData = searchColumns; |
||||
|
//清空数据 |
||||
|
this.customerReportList = []; |
||||
|
this.customerColumnlArray = []; |
||||
|
//刷新页面的参数 |
||||
|
this.runCustomerReportData(); |
||||
|
}, |
||||
|
|
||||
|
/*关闭modal*/ |
||||
|
closeDialog(){ |
||||
|
this.$emit('update:visible', false); |
||||
|
}, |
||||
|
|
||||
|
/*刷新当前的页面参数*/ |
||||
|
runCustomerReportData(){ |
||||
|
//页面请求参数 |
||||
|
let requestData = {searchColumnList: JSON.stringify(this.searchColumnData), pageData: JSON.stringify(this.pageData)}; |
||||
|
runCustomerReport(requestData).then(({data}) => { |
||||
|
//判断是否成功 |
||||
|
if(data.code === 200){ |
||||
|
debugger; |
||||
|
this.customerReportList = data.resultMap.resultRows; |
||||
|
this.customerColumnlArray = data.resultMap.columnRows; |
||||
|
}else{ |
||||
|
this.$message.error(data.msg); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
created() { |
||||
|
// |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
/*调节页面button和input的上下间距*/ |
||||
|
.customer-css .customer-button{ |
||||
|
margin-top: 25px; |
||||
|
} |
||||
|
|
||||
|
/*调节样式*/ |
||||
|
.customer-item{ |
||||
|
margin-top: -10px; |
||||
|
} |
||||
|
/*fieldset下table的样式*/ |
||||
|
.customer-fieldset /deep/ .el-table__header th.is-leaf{ |
||||
|
line-height: 16px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .customer-tab .el-tabs__content{ |
||||
|
padding: 0px !important; |
||||
|
} |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,239 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" |
||||
|
width="650px" style="height: 490px;" class="customer-dialog"> |
||||
|
<el-form :inline="true" label-position="top" style="height: 260px;" |
||||
|
label-width="80px"> |
||||
|
<!-- 主材料 --> |
||||
|
<el-form> |
||||
|
<fieldset class="customer-fieldset" style="width: 630px;"> |
||||
|
<el-table height="240" |
||||
|
:cell-style="customerCellStyle" :cell-class-name="customerCellClassName" |
||||
|
:data="searchColumnList" |
||||
|
border |
||||
|
v-loading="dataListLoading" |
||||
|
style="width: 100%; margin-top: 0px;"> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in searchColumnlArray" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed" |
||||
|
:width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input type="number" class="table-number-input" v-if="item.columnProp === 'columnDefaultValue' && scope.row.columnType === '数字'" |
||||
|
v-model="scope.row[item.columnProp]"></el-input> |
||||
|
<el-input type="text" class="table-text-input" v-if="item.columnProp === 'columnDefaultValue' && scope.row.columnType === '文本'" |
||||
|
v-model="scope.row[item.columnProp]"></el-input> |
||||
|
<span v-else>{{scope.row[item.columnProp]}}</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
||||
|
style="width: 100px; height: 80px"/></span> |
||||
|
|
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</fieldset> |
||||
|
</el-form> |
||||
|
</el-form> |
||||
|
<span slot="footer" class="dialog-footer" style="margin-top: 0px;"> |
||||
|
<el-button type="primary" @click="runCustomerReportModal">执行</el-button> |
||||
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
|
||||
|
<!-- 查询列展示 --> |
||||
|
<runCustomerReport ref="runCustomerReport" :close-on-click-modal="false" |
||||
|
:visible.sync="showRunCustomerReportFlag"> |
||||
|
</runCustomerReport> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
/*组件*/ |
||||
|
import runCustomerReport from '@/views/modules/report/com_run_customer_report';/*运行自定义报表的功能*/ |
||||
|
/*引入js*/ |
||||
|
import { |
||||
|
getSearchColumns, |
||||
|
} from '@/api/report/com_show_customer_report_search_column.js'; |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
titleCon: '查询列', |
||||
|
showRunCustomerReportFlag: false, |
||||
|
pageData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: this.$store.state.user.name, |
||||
|
reportId: '', |
||||
|
}, |
||||
|
searchColumnList: [], |
||||
|
searchColumnlArray: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5307, |
||||
|
serialNumber: '5307CustomerColumnField', |
||||
|
tableId: "5307Customer", |
||||
|
tableName: "查询列", |
||||
|
columnProp: "columnField", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "参数ID", |
||||
|
columnWidth: 120, |
||||
|
columnHidden: false, |
||||
|
columnAttr: 'ori', |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5307, |
||||
|
serialNumber: '5307CustomerColumnName', |
||||
|
tableId: "5307Customer", |
||||
|
tableName: "查询列", |
||||
|
columnProp: "columnName", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "参数名称", |
||||
|
columnWidth: 140, |
||||
|
columnHidden: false, |
||||
|
columnAttr: 'ori', |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5307, |
||||
|
serialNumber: '5307CustomerColumnDefaultValue', |
||||
|
tableId: "5307Customer", |
||||
|
tableName: "查询列", |
||||
|
columnProp: "columnDefaultValue", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "参数默认值", |
||||
|
columnWidth: 160, |
||||
|
columnHidden: false, |
||||
|
columnAttr: 'text', |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5307, |
||||
|
serialNumber: '5307CustomerColumnRemark', |
||||
|
tableId: "5307Customer", |
||||
|
tableName: "查询列", |
||||
|
columnProp: "columnRemark", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "备注", |
||||
|
columnWidth: 200, |
||||
|
columnHidden: false, |
||||
|
columnAttr: 'ori', |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
], |
||||
|
dataListLoading: false, |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/*组件*/ |
||||
|
components: { |
||||
|
runCustomerReport,/*运行报表的功能*/ |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
/*初始化页面参数*/ |
||||
|
init(reportId) { |
||||
|
//设置参数 |
||||
|
this.pageData.reportId = reportId; |
||||
|
//刷新页面的参数 |
||||
|
this.refreshPageData(); |
||||
|
}, |
||||
|
|
||||
|
/*关闭modal*/ |
||||
|
closeDialog(){ |
||||
|
this.$emit('update:visible', false); |
||||
|
}, |
||||
|
|
||||
|
/*刷新当前的页面参数*/ |
||||
|
refreshPageData(){ |
||||
|
//刷新材料的数据 |
||||
|
this.refreshSearchColumnTable(); |
||||
|
}, |
||||
|
|
||||
|
//刷新当前卷的时间数据 |
||||
|
refreshSearchColumnTable(){ |
||||
|
getSearchColumns(this.pageData).then(({data}) => { |
||||
|
this.searchColumnList = data.rows; |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
/*添加定制的css类*/ |
||||
|
customerCellClassName({row, column, rowIndex, columnIndex}) { |
||||
|
if(column.property == 'sortNo'){ |
||||
|
return 'customer-number-cell'; |
||||
|
}else if(columnIndex === 2){ |
||||
|
return 'customer-text-cell'; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/*添加定制的cess样式*/ |
||||
|
customerCellStyle({row, column, rowIndex, columnIndex}) { |
||||
|
if(columnIndex === 2){ |
||||
|
return 'padding: 0px 0px;'; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
/*保存已经修改好的参数数据*/ |
||||
|
runCustomerReportModal(){ |
||||
|
this.$nextTick(() => { |
||||
|
this.showRunCustomerReportFlag = true; |
||||
|
this.$refs.runCustomerReport.init(this.pageData.reportId, this.searchColumnList); |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
created() { |
||||
|
// |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
/*调节页面button和input的上下间距*/ |
||||
|
.customer-css .customer-button{ |
||||
|
margin-top: 25px; |
||||
|
} |
||||
|
|
||||
|
/*调节样式*/ |
||||
|
.customer-item{ |
||||
|
margin-top: -10px; |
||||
|
} |
||||
|
/*fieldset下table的样式*/ |
||||
|
.customer-fieldset /deep/ .el-table__header th.is-leaf{ |
||||
|
line-height: 16px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .customer-tab .el-tabs__content{ |
||||
|
padding: 0px !important; |
||||
|
} |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,152 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" |
||||
|
width="580px" style="height: 600px;" class="customer-dialog"> |
||||
|
<el-form :inline="true" label-position="top" style="height: 320px;" |
||||
|
label-width="80px"> |
||||
|
<!-- 信息 --> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item :label="'报表名称:'" > |
||||
|
<el-input v-model="pageData.reportName" ref="reportName" style="width: 220px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item :label="'报表分类:'" style="margin-left: 0px;"> |
||||
|
<el-select v-model="pageData.reportType" style="width: 80px"> |
||||
|
<el-option |
||||
|
v-for="(item, index) in reportTypeList" |
||||
|
:key="index" |
||||
|
:label="item.baseData" |
||||
|
:value="item.baseData"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item :label="'报表ID:'" style="margin-left: 0px;"> |
||||
|
<el-input v-model="pageData.reportId" readonly="readonly" style="width: 140px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item :label="'备注:'" > |
||||
|
<el-input v-model="pageData.reportRemark" style="width: 560px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24" > |
||||
|
<el-form-item :label="'SQL语句:'" > |
||||
|
<el-input type="textarea" style="width: 560px;" class="customer-textarea" ref="reportSql" v-model="pageData.reportSql" :rows="10" :cols="85"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<span slot="footer" class="dialog-footer" style="margin-top: -20px;"> |
||||
|
<el-button type="primary" @click="saveCustomerReportBun">保存</el-button> |
||||
|
<el-button type="primary" @click="editCustomerReportSearchModal">列维护</el-button> |
||||
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getReportTypeList, |
||||
|
getCustomerReportByReportId, |
||||
|
saveCustomerReport, |
||||
|
} from '@/api/report/com_update_customer_report.js' |
||||
|
export default { |
||||
|
name: "com_exception_reason", |
||||
|
data() { |
||||
|
return { |
||||
|
titleCon: '报表自定义-修改', |
||||
|
reportTypeList: [], |
||||
|
pageData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: this.$store.state.user.name, |
||||
|
reportId: '', |
||||
|
reportName: '', |
||||
|
reportRemark: '', |
||||
|
reportType: '', |
||||
|
reportSql: '', |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
/*初始化页面参数*/ |
||||
|
init(reportId) { |
||||
|
//初始化页面的数据 |
||||
|
this.pageData.reportId = reportId; |
||||
|
//清空参数 |
||||
|
this.pageData.reportName = ''; |
||||
|
this.pageData.reportSql = ''; |
||||
|
this.pageData.reportRemark = ''; |
||||
|
//自动获取焦点 |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.reportName.focus(); |
||||
|
}); |
||||
|
//查询报工的数据 |
||||
|
this.getCustomerReportByCon(); |
||||
|
}, |
||||
|
|
||||
|
/*关闭modal*/ |
||||
|
closeDialog(){ |
||||
|
this.$emit('update:visible', false); |
||||
|
}, |
||||
|
|
||||
|
/*刷新报工的类型*/ |
||||
|
refreshReportType(){ |
||||
|
let requestData = {type: 'report_type', secondType: 'select'}; |
||||
|
getReportTypeList(requestData).then(({data}) => { |
||||
|
this.reportTypeList = data.rows; |
||||
|
//删除ALL的选项 |
||||
|
this.pageData.reportType = data.rows[0].baseData; |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/*添加异常原因的数据*/ |
||||
|
getCustomerReportByCon(){ |
||||
|
//调用保存的方法 |
||||
|
getCustomerReportByReportId(this.pageData).then(({data}) => { |
||||
|
//设置参数 |
||||
|
this.pageData.reportName = data.row.reportName; |
||||
|
this.pageData.reportType = data.row.reportType; |
||||
|
this.pageData.reportRemark = data.row.reportRemark; |
||||
|
this.pageData.reportSql = data.row.reportSql; |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
/*保存定制报表的信息*/ |
||||
|
saveCustomerReportBun(){ |
||||
|
saveCustomerReport(this.pageData).then(({data}) => { |
||||
|
if (data.code == 200){ |
||||
|
this.$message.success(data.msg); |
||||
|
}else{ |
||||
|
this.$message.error(data.msg); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
editCustomerReportSearchModal(){ |
||||
|
//关闭当前的组件 |
||||
|
this.closeDialog(); |
||||
|
//处理结束卷组件的方法 |
||||
|
this.$emit('initExceptionReason', this.pageData.exceptionReason); |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
created() { |
||||
|
//查询报表的类型 |
||||
|
this.refreshReportType(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue