|
|
@@ -0,0 +1,184 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <!--内框顶部显示-->
|
|
|
+ <el-card class="box-card" style="height: calc(100vh - 115px);position:relative">
|
|
|
+ <div slot="header">
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!--内框表格显示-->
|
|
|
+ <el-table id="rebateSetTable" size="mini" :data="entityList" border height="calc(100vh - 243px)"
|
|
|
+ style="width: 100%" @sort-change="orderby">
|
|
|
+ <!--内框表格剩余栏显示-->
|
|
|
+ <el-table-column label="企业名称" prop="SupplierName" sortable align="center"></el-table-column>
|
|
|
+ <el-table-column label="曾用名" prop="OldSupplierName" align="center"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+
|
|
|
+<script>
|
|
|
+ import api from "@/api/oilsupplier/usednameselect";
|
|
|
+ import FileSaver from "file-saver";
|
|
|
+ import XLSX from "xlsx";
|
|
|
+ export default {
|
|
|
+
|
|
|
+ name:'usednameselectIndex',
|
|
|
+ props: {
|
|
|
+ formData: {
|
|
|
+ type: Object,
|
|
|
+ default: {}
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ console.log(123,this.formData.SupplierName)
|
|
|
+ // 执行初始化方法
|
|
|
+ this.initDatas()
|
|
|
+ // this.initDatas()
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ // 定义列表数据
|
|
|
+ entityList: [],
|
|
|
+ CreateOn: [],
|
|
|
+ // 分页参数
|
|
|
+ size: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ currentItemCount: 0,
|
|
|
+ searchForm: {
|
|
|
+ SupplierName: '',
|
|
|
+ CreateOn: ''
|
|
|
+ },
|
|
|
+ // 列表排序
|
|
|
+ Column: {
|
|
|
+ Order: "",
|
|
|
+ Prop: ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ // 初始化列表方法
|
|
|
+ initDatas () {
|
|
|
+ let myCreateOn = []
|
|
|
+ // 解析时间
|
|
|
+ if (this.CreateOn != null && this.CreateOn.length === 2) {
|
|
|
+ this.CreateOn[1].setHours(23)
|
|
|
+ this.CreateOn[1].setMinutes(59)
|
|
|
+ this.CreateOn[1].setSeconds(59)
|
|
|
+ myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
|
|
|
+ myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
|
|
|
+ }
|
|
|
+
|
|
|
+ this.searchForm.CreateOn = myCreateOn.join(',')
|
|
|
+
|
|
|
+ // if (event != null) {
|
|
|
+ // console.log(666666666,event)
|
|
|
+ this.currentPage = 1
|
|
|
+ // }
|
|
|
+ let params = {
|
|
|
+ _size: this.size,
|
|
|
+ _currentPage: this.currentPage,
|
|
|
+ Order: this.Column.Order,
|
|
|
+ Prop: this.Column.Prop,
|
|
|
+ SupplierName:this.formData.SupplierName,
|
|
|
+
|
|
|
+ }
|
|
|
+ // 查询条件
|
|
|
+ // Object.assign(params, this.searchForm)
|
|
|
+ api.getNameList(params, this.$axios)
|
|
|
+ .then(res => {
|
|
|
+ console.log(res.data.items)
|
|
|
+ this.entityList = res.data.items
|
|
|
+ this.currentItemCount = res.data.currentItemCount
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ exportExcel () {
|
|
|
+ /* generate workbook object from table */
|
|
|
+ let wb = XLSX.utils.table_to_book(
|
|
|
+ document.querySelector("#rebateSetTable")
|
|
|
+ );
|
|
|
+ /* get binary string as output */
|
|
|
+ let wbout = XLSX.write(wb, {
|
|
|
+ bookType: "xlsx",
|
|
|
+ bookSST: true,
|
|
|
+ type: "array"
|
|
|
+ });
|
|
|
+ try {
|
|
|
+ FileSaver.saveAs(
|
|
|
+ new Blob([wbout], {
|
|
|
+ type: "application/octet-stream"
|
|
|
+ }),
|
|
|
+ "SupplierUsedName.xlsx"
|
|
|
+ );
|
|
|
+ } catch (e) {
|
|
|
+ if (typeof console !== "undefined") console.log(e, wbout);
|
|
|
+ }
|
|
|
+ return wbout;
|
|
|
+ },
|
|
|
+
|
|
|
+ formatDateTime (date) {
|
|
|
+ var y = date.getFullYear()
|
|
|
+ var m = date.getMonth() + 1
|
|
|
+ m = m < 10 ? ('0' + m) : m
|
|
|
+ var d = date.getDate()
|
|
|
+ d = d < 10 ? ('0' + d) : d
|
|
|
+ var h = date.getHours()
|
|
|
+ var minute = date.getMinutes()
|
|
|
+ minute = minute < 10 ? ('0' + minute) : minute
|
|
|
+ return y + '-' + m + '-' + d + ' ' + h + ':' + minute
|
|
|
+ },
|
|
|
+ // 列表排序功能
|
|
|
+ orderby(column) {
|
|
|
+ if (column.order == "ascending") {
|
|
|
+ this.Column.Order = "asc";
|
|
|
+ } else if (column.order == "descending") {
|
|
|
+ this.Column.Order = "desc";
|
|
|
+ }
|
|
|
+ this.Column.Prop = column.prop;
|
|
|
+ this.initDatas();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 分页方法
|
|
|
+ handleCurrentChange (value) {
|
|
|
+ this.currentPage = value
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+ handleSizeChange (value) {
|
|
|
+ this.size = value
|
|
|
+ this.currentPage = 1
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+ searchCommand (command) {
|
|
|
+ if (command === 'clear') {
|
|
|
+ this.clearSearch()
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ clearSearch () {
|
|
|
+ this.searchForm.SupplierName = ''
|
|
|
+ this.CreateOn = []
|
|
|
+ this.currentPage = 1
|
|
|
+ this.initDatas()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+ .eldialog .el-input__inner {
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .eldialog .el-textarea__inner {
|
|
|
+ border: none;
|
|
|
+ resize: none;
|
|
|
+ height: 70px;
|
|
|
+ }
|
|
|
+
|
|
|
+</style>
|