|
|
@@ -0,0 +1,150 @@
|
|
|
+<template>
|
|
|
+ <div v-loading="loading">
|
|
|
+ <div class="white-box">
|
|
|
+ <div class="filter-box">
|
|
|
+ <filter-user :filter-types="filterTypes" @select-value="handleFilterUser"></filter-user>
|
|
|
+ </div>
|
|
|
+ <el-table class="table-box" ref="multipleTable" :data="tableData" stripe style="width: 100%;"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ :height="tool.getTableHeight()">
|
|
|
+ <el-table-column type="selection" width="70" v-if="tableHeaders"></el-table-column>
|
|
|
+ <el-table-column v-for="(tableHeader, key) in tableHeaders" :key="key" :label="tableHeader.header" :width="tableHeader.other.width ? tableHeader.other.width : ''" :prop="tableHeader.other.prop ? tableHeader.other.prop : null">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <template v-if="scope.row[tableHeader.index].other.tag" >
|
|
|
+ <el-tag :type="scope.row[tableHeader.index].other.tag.type ? scope.row[tableHeader.index].other.tag.type : null" :size="scope.row[tableHeader.index].other.tag.size ? scope.row[tableHeader.index].other.tag.size : null" :class="scope.row[tableHeader.index].other.tag.class ? scope.row[tableHeader.index].other.tag.class : null" >{{scope.row[tableHeader.index].value}}</el-tag>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <div v-html="scope.row[tableHeader.index].value"></div>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="white-box-footer">
|
|
|
+ <el-button type="success" size="small" @click="handleImport" v-show="permission.hasPermission(`shop/order-dec-list-import`)">Order import<!-- 订单导入 --></el-button>
|
|
|
+
|
|
|
+ <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"></pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-dialog title="Order import" :visible.sync="importDialogVisible" width="50%"><!-- 订单导入 -->
|
|
|
+ <el-form ref="form" :model="excelForm" style="width: 100%;" class="form-page">
|
|
|
+ <el-form-item label="Current import order date"><!-- 当前导入订单日期 -->
|
|
|
+ <el-date-picker v-model="excelForm.orderDay" type="date" placeholder="Select date" value-format="yyyy-MM-dd"><!-- 选择日期 -->
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-show="false" label="Current import order periods"><!-- 当前导入订单期数 -->
|
|
|
+ <el-input v-model="excelForm.periodNum"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="Total rows of Excel file"><!-- Excel 文件总行数 -->
|
|
|
+ <el-input v-model="excelForm.rowCount"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <leo-excel-uploader
|
|
|
+ :request-upload-route="`file/upload-excel`"
|
|
|
+ :request-import-to-excel-table-route="`shop/import-order-dec-to-excel-table`"
|
|
|
+ :request-import-excel-table-to-data-route="`shop/import-order-dec`"
|
|
|
+ :import-row-count="excelForm.rowCount"
|
|
|
+ :other-params="excelForm"
|
|
|
+ :finish-callback-func="uploadFinishFunc"
|
|
|
+ excel-option="addUser"
|
|
|
+ upload-btn-title="Excel import"
|
|
|
+ style="float: left;"
|
|
|
+ ></leo-excel-uploader><!-- Excel导入 -->
|
|
|
+ <!-- <el-button type="primary" @click="handleExcel" style="float: left; margin-left: 10px;">下载模板</el-button>-->
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <script>
|
|
|
+ import network from '@/utils/network'
|
|
|
+ import tool from '@/utils/tool'
|
|
|
+ import baseInfo from '@/utils/baseInfo'
|
|
|
+ import FilterUser from '@/components/FilterUser'
|
|
|
+ import permission from '@/utils/permission'
|
|
|
+ import LeoExcelUploader from '../../components/ExcelUploader'
|
|
|
+ import Pagination from '@/components/Pagination'
|
|
|
+ import filterHelper from '@/utils/filterHelper'
|
|
|
+ import {CDN_BASE_URL} from "../../utils/config";
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: 'shop_order_dec-list',
|
|
|
+ components: {FilterUser, Pagination, LeoExcelUploader},
|
|
|
+ mounted() {
|
|
|
+ this.initData()
|
|
|
+ this.getData()
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tableHeaders: null,
|
|
|
+ tableData: null,
|
|
|
+ tableHeight: window.innerHeight - 310,
|
|
|
+ loading: true,
|
|
|
+ multipleSelection: [],
|
|
|
+ currentPage: 1,
|
|
|
+ totalPages: 1,
|
|
|
+ totalCount: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ tool: tool,
|
|
|
+ permission: permission,
|
|
|
+ filterTypes: null,
|
|
|
+ filterModel: {},
|
|
|
+ dialogDeliveryVisible: false,
|
|
|
+ deliveryForm: {
|
|
|
+ sn: '',
|
|
|
+ expressCompany: '',
|
|
|
+ orderTrackNo: '',
|
|
|
+ },
|
|
|
+ excelForm: {
|
|
|
+ rowCount: 0,
|
|
|
+ periodNum: 0,
|
|
|
+ orderDay: 0,
|
|
|
+ },
|
|
|
+ importDialogVisible:false,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ this.multipleSelection = val
|
|
|
+ },
|
|
|
+ handleCurrentChange(page) {
|
|
|
+ this.getData(page, this.pageSize)
|
|
|
+ },
|
|
|
+ handleSizeChange(pageSize) {
|
|
|
+ this.getData(this.currentPage, pageSize)
|
|
|
+ },
|
|
|
+ handleFilterUser(filterData) {
|
|
|
+ filterHelper.handleFilterUser(this, filterData)
|
|
|
+ },
|
|
|
+ initData(){
|
|
|
+ let myDate = new Date();
|
|
|
+ let thisYear = myDate.getFullYear();
|
|
|
+ let thisMonth = myDate.getMonth() + 1 < 10 ? '0' + (myDate.getMonth() + 1) : myDate.getMonth() + 1
|
|
|
+ let thisDate = myDate.getDate() < 10 ? '0' + (myDate.getDate()) : myDate.getDate()
|
|
|
+ this.excelForm.orderDay = thisYear + '-' + thisMonth + '-' + thisDate
|
|
|
+ },
|
|
|
+ getData(page, pageSize) {
|
|
|
+ let filterData = this.filterModel
|
|
|
+ network.getPageData(this, 'shop/order-dec-list', page, pageSize, filterData, response => {
|
|
|
+ this.filterTypes = response.filterTypes
|
|
|
+ this.allData = response
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleExcel() {
|
|
|
+ window.open(CDN_BASE_URL + `/files/order-dec-import.xlsx`)
|
|
|
+ },
|
|
|
+ handleImport() {
|
|
|
+ this.importDialogVisible = true
|
|
|
+ },
|
|
|
+ uploadFinishFunc(){
|
|
|
+ this.importDialogVisible = false
|
|
|
+ this.getData()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+
|
|
|
+ <style scoped>
|
|
|
+ </style>
|
|
|
+
|