|
@@ -1,13 +1,8 @@
|
|
|
<template>
|
|
|
<div id="order-check">
|
|
|
- <el-dialog
|
|
|
- title="查看图片"
|
|
|
- :visible.sync="dialogVisible"
|
|
|
- width="45%"
|
|
|
- center
|
|
|
- >
|
|
|
- <div style="text-align:center;">
|
|
|
- <img style="width:100%" :src="invoiceImg" alt="">
|
|
|
+ <el-dialog title="查看图片" :visible.sync="dialogVisible" width="45%" center>
|
|
|
+ <div style="text-align: center">
|
|
|
+ <img style="width: 100%" :src="invoiceImg" alt="" />
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="dialogVisible = false">关 闭</el-button>
|
|
@@ -33,104 +28,173 @@
|
|
|
<div class="order-management-table">
|
|
|
<div class="order-check_tab">
|
|
|
<ul>
|
|
|
- <li v-for="(item,index) in tabs" :key="index" :class="{'order-check_tab_li_active':item.idx==tabIndex}" @click="clickTabItem(item.idx)">{{item.name}}<span v-if="item.idx != 1" style="margin:0 10px;color: #999;font-weight: normal;">/</span></li>
|
|
|
+ <li
|
|
|
+ v-for="(item, index) in tabs"
|
|
|
+ :key="index"
|
|
|
+ :class="{ 'order-check_tab_li_active': item.idx == tabIndex }"
|
|
|
+ @click="clickTabItem(item.idx)"
|
|
|
+ >
|
|
|
+ {{ item.name
|
|
|
+ }}<span
|
|
|
+ v-if="item.idx != 1"
|
|
|
+ style="margin: 0 10px; color: #999; font-weight: normal"
|
|
|
+ >/</span
|
|
|
+ >
|
|
|
+ </li>
|
|
|
</ul>
|
|
|
- <div style="float: right;vertical-align: middle;">
|
|
|
+ <div style="float: right; vertical-align: middle">
|
|
|
<!-- <el-select v-model="selectValue" placeholder="请选择">
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
|
|
</el-option>
|
|
|
</el-select> -->
|
|
|
- <el-button type="primary" @click="_exportExcelForOrder" color='red'>导出</el-button>
|
|
|
+
|
|
|
+ <!-- <el-button type="primary" @click="_exportExcelForOrder" color="red"
|
|
|
+ >导出</el-button
|
|
|
+ > -->
|
|
|
+ <el-button type="primary" @click="_exportExcelForInvoice" color="red"
|
|
|
+ >导出</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-table ref="order_table" @expand-change="_getOrderDetail" class='e-table' :data="orders" style="width: 100%">
|
|
|
- <el-table-column type="index">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column v-for="(item,i) in tableHeader" :key="i" :prop="item.name" :label="item.label">
|
|
|
+ <el-table
|
|
|
+ ref="order_table"
|
|
|
+ @expand-change="_getOrderDetail"
|
|
|
+ class="e-table"
|
|
|
+ :data="orders"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-table-column type="index"> </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ v-for="(item, i) in tableHeader"
|
|
|
+ :key="i"
|
|
|
+ :prop="item.name"
|
|
|
+ :label="item.label"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{scope.row[item.name]||'-'}}</span>
|
|
|
+ <span>{{ scope.row[item.name] || "-" }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column type="expand" prop="operation" label="操作" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
<div class="order_check_row">
|
|
|
<div class="product_info">
|
|
|
- <div class="product_info_title">
|
|
|
- 商品信息
|
|
|
- </div>
|
|
|
- <el-table @expand-change="_getOrderDetail" class='e-table' :data="scope.row.orderItems" style="width: 100%">
|
|
|
- <el-table-column v-for="(item,i) in itemHeader" :key="i" :prop="item.name" :label="item.label">
|
|
|
+ <div class="product_info_title">商品信息</div>
|
|
|
+ <el-table
|
|
|
+ @expand-change="_getOrderDetail"
|
|
|
+ class="e-table"
|
|
|
+ :data="scope.row.orderItems"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ v-for="(item, i) in itemHeader"
|
|
|
+ :key="i"
|
|
|
+ :prop="item.name"
|
|
|
+ :label="item.label"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{scope.row[item.name]||'-'}}</span>
|
|
|
+ <span>{{ scope.row[item.name] || "-" }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <div class="total">总价:{{scope.row.money}}</div>
|
|
|
+ <div class="total">总价:{{ scope.row.money }}</div>
|
|
|
</div>
|
|
|
<div class="order_info">
|
|
|
- <div class="order_info_title">
|
|
|
- 下单信息
|
|
|
- </div>
|
|
|
+ <div class="order_info_title">下单信息</div>
|
|
|
<div class="order_info_body">
|
|
|
<div class="order_info_body_info">
|
|
|
<div class="order_info_body_info_item">
|
|
|
<span class="order_info_body_info_item_title">顾客姓名</span>
|
|
|
- <span class="order_info_body_info_item_content">{{scope.row.shipName||'-'}}</span>
|
|
|
+ <span class="order_info_body_info_item_content">{{
|
|
|
+ scope.row.shipName || "-"
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<div class="order_info_body_info_item">
|
|
|
<span class="order_info_body_info_item_title">电话</span>
|
|
|
- <span class="order_info_body_info_item_content">{{scope.row.shipMobile||'-'}}</span>
|
|
|
+ <span class="order_info_body_info_item_content">{{
|
|
|
+ scope.row.shipMobile || "-"
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<div class="order_info_body_info_item">
|
|
|
<span class="order_info_body_info_item_title">收货地址</span>
|
|
|
- <span class="order_info_body_info_item_content">{{scope.row.shipAddress||'-'}}</span>
|
|
|
+ <span class="order_info_body_info_item_content">{{
|
|
|
+ scope.row.shipAddress || "-"
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
|
|
|
<template v-if="scope.row.type === 2">
|
|
|
<div class="order_info_body_info_item">
|
|
|
- <span class="order_info_body_info_item_title">电子邮件:</span>
|
|
|
- <span class="order_info_body_info_item_content">{{scope.row.emailAddress||'-'}}</span>
|
|
|
+ <span class="order_info_body_info_item_title"
|
|
|
+ >电子邮件:</span
|
|
|
+ >
|
|
|
+ <span class="order_info_body_info_item_content">{{
|
|
|
+ scope.row.emailAddress || "-"
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
|
|
|
<div class="order_info_body_info_item">
|
|
|
- <span class="order_info_body_info_item_title">电子发票:</span>
|
|
|
- <span class="order_info_body_info_item_content" style="position:relative;">
|
|
|
- <div style="display:inline-block;">
|
|
|
- <el-upload
|
|
|
- class="upload-demo"
|
|
|
- :headers="{token:token}"
|
|
|
- :on-change="handleChange"
|
|
|
- :file-list="fileList"
|
|
|
- :on-success="upload_success"
|
|
|
- :on-error="upload_fail"
|
|
|
- :action="`https://test.4dkankan.com/api/manager/invoice/uploadEInvoice`"
|
|
|
- :limit="1"
|
|
|
- >
|
|
|
- <el-button size="small" type="primary">{{scope.row.einvoice?'更改发票':'上传发票'}}</el-button>
|
|
|
- </el-upload>
|
|
|
+ <span class="order_info_body_info_item_title"
|
|
|
+ >电子发票:</span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="order_info_body_info_item_content"
|
|
|
+ style="position: relative"
|
|
|
+ >
|
|
|
+ <div style="display: inline-block">
|
|
|
+ <el-upload
|
|
|
+ class="upload-demo"
|
|
|
+ :headers="{ token: token }"
|
|
|
+ :on-change="handleChange"
|
|
|
+ :file-list="fileList"
|
|
|
+ :on-success="upload_success"
|
|
|
+ :on-error="upload_fail"
|
|
|
+ :action="`https://test.4dkankan.com/api/manager/invoice/uploadEInvoice`"
|
|
|
+ :limit="1"
|
|
|
+ >
|
|
|
+ <el-button size="small" type="primary">{{
|
|
|
+ scope.row.einvoice ? "更改发票" : "上传发票"
|
|
|
+ }}</el-button>
|
|
|
+ </el-upload>
|
|
|
</div>
|
|
|
|
|
|
- <span style="color:#1fe4dc;margin-left:10px; cursor:pointer;" @click="lookInvoice">查看电子发票</span>
|
|
|
+ <span
|
|
|
+ style="
|
|
|
+ color: #1fe4dc;
|
|
|
+ margin-left: 10px;
|
|
|
+ cursor: pointer;
|
|
|
+ "
|
|
|
+ @click="lookInvoice"
|
|
|
+ >查看电子发票</span
|
|
|
+ >
|
|
|
</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<template v-if="scope.row.type === 3">
|
|
|
- <div class="order_info_body_info_item">
|
|
|
- <span class="order_info_body_info_item_title">快递单号:</span>
|
|
|
+ <div class="order_info_body_info_item">
|
|
|
+ <span class="order_info_body_info_item_title"
|
|
|
+ >快递单号:</span
|
|
|
+ >
|
|
|
<span class="order_info_body_info_item_content">
|
|
|
<el-input
|
|
|
- v-model="scope.row.expressNumber" maxlength="15" placeholder="请输入15位顺丰快单号"
|
|
|
- type="text">
|
|
|
+ v-model="scope.row.expressNumber"
|
|
|
+ maxlength="15"
|
|
|
+ placeholder="请输入15位顺丰快单号"
|
|
|
+ type="text"
|
|
|
+ >
|
|
|
</el-input>
|
|
|
</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<div class="order_info_body_info_item">
|
|
|
- <span class="order_info_body_info_item_title">开票备注:</span>
|
|
|
+ <span class="order_info_body_info_item_title"
|
|
|
+ >开票备注:</span
|
|
|
+ >
|
|
|
<span class="order_info_body_info_item_content">
|
|
|
- <div style="width:220px;display:inline-block;" >
|
|
|
- <el-input type="textarea" v-model="scope.row.remarks"></el-input>
|
|
|
+ <div style="width: 220px; display: inline-block">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ v-model="scope.row.remarks"
|
|
|
+ ></el-input>
|
|
|
</div>
|
|
|
</span>
|
|
|
</div>
|
|
@@ -138,7 +202,9 @@
|
|
|
<div class="order_info_body_info_item">
|
|
|
<span class="order_info_body_info_item_title"></span>
|
|
|
<span class="order_info_body_info_item_content">
|
|
|
- <el-button type="primary" @click="saveRow(scope.row)">{{scope.row.type === 2?'发送':'保存'}}</el-button>
|
|
|
+ <el-button type="primary" @click="saveRow(scope.row)">{{
|
|
|
+ scope.row.type === 2 ? "发送" : "保存"
|
|
|
+ }}</el-button>
|
|
|
<el-button @click="hideRow(scope.row)">取消</el-button>
|
|
|
</span>
|
|
|
</div>
|
|
@@ -152,7 +218,13 @@
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<div class="order-management-pagination">
|
|
|
- <el-pagination @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="10" layout="total, prev, pager, next, jumper" :total="total">
|
|
|
+ <el-pagination
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page.sync="currentPage"
|
|
|
+ :page-size="10"
|
|
|
+ layout="total, prev, pager, next, jumper"
|
|
|
+ :total="total"
|
|
|
+ >
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -162,40 +234,52 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-const tableHeader = [{
|
|
|
- name: 'orderSn',
|
|
|
- label: '订单编号'
|
|
|
-}, {
|
|
|
- name: 'typeStr',
|
|
|
- label: '发票类型'
|
|
|
-}, {
|
|
|
- name: 'money',
|
|
|
- label: '开票金额'
|
|
|
-}, {
|
|
|
- name: 'title',
|
|
|
- label: '发票抬头'
|
|
|
-}, {
|
|
|
- name: 'code',
|
|
|
- label: '18位税号'
|
|
|
-}, {
|
|
|
- name: 'organizedAddress',
|
|
|
- label: '注册地址'
|
|
|
-}, {
|
|
|
- name: 'registerPhone',
|
|
|
- label: '注册电话'
|
|
|
-}, {
|
|
|
- name: 'bankAccount',
|
|
|
- label: '银行账号'
|
|
|
-}, {
|
|
|
- name: 'shipAddress',
|
|
|
- label: '收件地址'
|
|
|
-}, {
|
|
|
- name: 'emailAddress',
|
|
|
- label: '电子邮箱'
|
|
|
-}, {
|
|
|
- name: 'shipMobile',
|
|
|
- label: '手机号码'
|
|
|
-}]
|
|
|
+const tableHeader = [
|
|
|
+ {
|
|
|
+ name: 'orderSn',
|
|
|
+ label: '订单编号'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'typeStr',
|
|
|
+ label: '发票类型'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'money',
|
|
|
+ label: '开票金额'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'title',
|
|
|
+ label: '发票抬头'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'code',
|
|
|
+ label: '18位税号'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'organizedAddress',
|
|
|
+ label: '注册地址'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'registerPhone',
|
|
|
+ label: '注册电话'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'bankAccount',
|
|
|
+ label: '银行账号'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'shipAddress',
|
|
|
+ label: '收件地址'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'emailAddress',
|
|
|
+ label: '电子邮箱'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'shipMobile',
|
|
|
+ label: '手机号码'
|
|
|
+ }
|
|
|
+]
|
|
|
|
|
|
const itemHeader = [
|
|
|
{
|
|
@@ -222,7 +306,6 @@ const TypeArr = {
|
|
|
}
|
|
|
|
|
|
export default {
|
|
|
-
|
|
|
name: 'order-check',
|
|
|
|
|
|
data () {
|
|
@@ -239,11 +322,11 @@ export default {
|
|
|
invalid: '已取消'
|
|
|
},
|
|
|
payMap: {
|
|
|
- '0': '微信',
|
|
|
- '1': '支付宝',
|
|
|
- '2': 'paypal',
|
|
|
- '3': '其他',
|
|
|
- '4': '货到付款'
|
|
|
+ 0: '微信',
|
|
|
+ 1: '支付宝',
|
|
|
+ 2: 'paypal',
|
|
|
+ 3: '其他',
|
|
|
+ 4: '货到付款'
|
|
|
},
|
|
|
paymentStatusMap: {
|
|
|
unpaid: '未付款',
|
|
@@ -264,30 +347,34 @@ export default {
|
|
|
orderSn: '',
|
|
|
fullscreenLoading: false,
|
|
|
product: {
|
|
|
- 'name': '',
|
|
|
- 'packageName': '',
|
|
|
- 'count': '',
|
|
|
- 'amount': '',
|
|
|
- 'url': ''
|
|
|
+ name: '',
|
|
|
+ packageName: '',
|
|
|
+ count: '',
|
|
|
+ amount: '',
|
|
|
+ url: ''
|
|
|
},
|
|
|
receive: {
|
|
|
- 'name': '',
|
|
|
- 'phone': '',
|
|
|
- 'address': '',
|
|
|
- 'invoice': '',
|
|
|
- 'expressNum': ''
|
|
|
+ name: '',
|
|
|
+ phone: '',
|
|
|
+ address: '',
|
|
|
+ invoice: '',
|
|
|
+ expressNum: ''
|
|
|
},
|
|
|
total: 0,
|
|
|
- options: [{
|
|
|
- value: '',
|
|
|
- label: '全部'
|
|
|
- }, {
|
|
|
- value: 2,
|
|
|
- label: '增值税普通发票'
|
|
|
- }, {
|
|
|
- value: 3,
|
|
|
- label: '增值税专用发票'
|
|
|
- }],
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ value: '',
|
|
|
+ label: '全部'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 2,
|
|
|
+ label: '增值税普通发票'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 3,
|
|
|
+ label: '增值税专用发票'
|
|
|
+ }
|
|
|
+ ],
|
|
|
selectValue: '',
|
|
|
// expressNum_input: "",
|
|
|
searchDate: [],
|
|
@@ -302,9 +389,7 @@ export default {
|
|
|
fileList: []
|
|
|
}
|
|
|
},
|
|
|
- watch: {
|
|
|
-
|
|
|
- },
|
|
|
+ watch: {},
|
|
|
methods: {
|
|
|
handleChange (file, fileList) {
|
|
|
// console.log('file', file)
|
|
@@ -334,7 +419,7 @@ export default {
|
|
|
this.search_value = e
|
|
|
},
|
|
|
async saveRow (row) {
|
|
|
- let {type, id, remarks, expressNumber} = row
|
|
|
+ let { type, id, remarks, expressNumber } = row
|
|
|
let params = {
|
|
|
invoiceId: id,
|
|
|
remarks,
|
|
@@ -344,28 +429,25 @@ export default {
|
|
|
}
|
|
|
var pattern = /^[\u4E00-\u9FA5]{1,5}$/
|
|
|
|
|
|
- let url = type === 2 ? '/manager/invoice/sendEInvoice' : '/manager/invoice/sendExpress'
|
|
|
+ let url =
|
|
|
+ type === 2 ? '/manager/invoice/sendEInvoice' : '/manager/invoice/sendExpress'
|
|
|
|
|
|
if (!this.invoiceImg && type === 2) {
|
|
|
return this.$alert('请上传电子发票', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
- callback: action => {
|
|
|
- }
|
|
|
+ callback: (action) => {}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
if (!expressNumber && type === 3) {
|
|
|
return this.$alert('请输入快递单号', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
- callback: action => {
|
|
|
- }
|
|
|
+ callback: (action) => {}
|
|
|
})
|
|
|
} else if (pattern.test(expressNumber) && type === 3) {
|
|
|
return this.$alert('快递单号不能为中文', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
- callback: action => {
|
|
|
-
|
|
|
- }
|
|
|
+ callback: (action) => {}
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -379,7 +461,7 @@ export default {
|
|
|
} else {
|
|
|
this.$alert('保存失败', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
- callback: action => {}
|
|
|
+ callback: (action) => {}
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -412,14 +494,16 @@ export default {
|
|
|
// console.log(searchDate,searchPhone,searchExpressNum,searchOrderNumber)
|
|
|
this.fullscreenLoading = true
|
|
|
|
|
|
- let data = (await this.$http.post('/manager/invoice/invoiceList', {
|
|
|
- pageNum: page,
|
|
|
- pageSize: 10,
|
|
|
- type: this.search_value,
|
|
|
- finish: this.tabIndex,
|
|
|
- orderSn: this.orderSn,
|
|
|
- searchKey: this.key_input
|
|
|
- })).data
|
|
|
+ let data = (
|
|
|
+ await this.$http.post('/manager/invoice/invoiceList', {
|
|
|
+ pageNum: page,
|
|
|
+ pageSize: 10,
|
|
|
+ type: this.search_value,
|
|
|
+ finish: this.tabIndex,
|
|
|
+ orderSn: this.orderSn,
|
|
|
+ searchKey: this.key_input
|
|
|
+ })
|
|
|
+ ).data
|
|
|
|
|
|
this.fullscreenLoading = false
|
|
|
let temp = data.list
|
|
@@ -427,48 +511,116 @@ export default {
|
|
|
// temp[i]['expressNum_input'] = "";
|
|
|
temp[i].items = []
|
|
|
temp[i]['typeStr'] = TypeArr[temp[i]['type']]
|
|
|
- temp[i].orderItems =
|
|
|
- temp[i]['orderDetail'] ? temp[i]['orderDetail']['orderItems']
|
|
|
- : temp[i]['responseVirtualOrder'] ? [{
|
|
|
- goodsName: temp[i]['responseVirtualOrder'].body,
|
|
|
- goodsCount: temp[i]['responseVirtualOrder'].orderCount,
|
|
|
- goodsPrice: temp[i]['responseVirtualOrder'].amount,
|
|
|
- abroad: temp[i]['responseVirtualOrder'].abroad
|
|
|
- }]
|
|
|
- : temp[i]['responseIncrementOrder'] ? [{
|
|
|
- goodsName: '会员权益',
|
|
|
- goodsCount: temp[i]['responseIncrementOrder'].count,
|
|
|
- goodsPrice: temp[i]['responseIncrementOrder'].amount,
|
|
|
- abroad: temp[i]['responseIncrementOrder'].abroad
|
|
|
- }] : ''
|
|
|
-
|
|
|
- temp[i]['orderSn'] =
|
|
|
- temp[i]['orderDetail'] ? temp[i]['orderDetail']['orderSn']
|
|
|
- : temp[i]['responseIncrementOrder'] ? temp[i]['responseIncrementOrder']['orderSn']
|
|
|
- : temp[i]['responseVirtualOrder'] ? temp[i]['responseVirtualOrder']['orderSn'] : ''
|
|
|
+ temp[i].orderItems = temp[i]['orderDetail']
|
|
|
+ ? temp[i]['orderDetail']['orderItems']
|
|
|
+ : temp[i]['responseVirtualOrder']
|
|
|
+ ? [
|
|
|
+ {
|
|
|
+ goodsName: temp[i]['responseVirtualOrder'].body,
|
|
|
+ goodsCount: temp[i]['responseVirtualOrder'].orderCount,
|
|
|
+ goodsPrice: temp[i]['responseVirtualOrder'].amount,
|
|
|
+ abroad: temp[i]['responseVirtualOrder'].abroad
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ : temp[i]['responseIncrementOrder']
|
|
|
+ ? [
|
|
|
+ {
|
|
|
+ goodsName: '会员权益',
|
|
|
+ goodsCount: temp[i]['responseIncrementOrder'].count,
|
|
|
+ goodsPrice: temp[i]['responseIncrementOrder'].amount,
|
|
|
+ abroad: temp[i]['responseIncrementOrder'].abroad
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ : ''
|
|
|
+
|
|
|
+ temp[i]['orderSn'] = temp[i]['orderDetail']
|
|
|
+ ? temp[i]['orderDetail']['orderSn']
|
|
|
+ : temp[i]['responseIncrementOrder']
|
|
|
+ ? temp[i]['responseIncrementOrder']['orderSn']
|
|
|
+ : temp[i]['responseVirtualOrder']
|
|
|
+ ? temp[i]['responseVirtualOrder']['orderSn']
|
|
|
+ : ''
|
|
|
}
|
|
|
this.orders = temp
|
|
|
this.currentPage = page
|
|
|
this.total = data.total
|
|
|
},
|
|
|
+ _exportExcelForInvoice () {
|
|
|
+ this.$confirm('确定当前标签下的订单记录?', '导出订单', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ // let exec = await this.$http.post('/manager/invoice/exportInvoiceList', {
|
|
|
+ // // pageNum: page,
|
|
|
+ // // pageSize: 10,
|
|
|
+ // type: this.search_value,
|
|
|
+ // finish: this.tabIndex,
|
|
|
+ // orderSn: this.orderSn,
|
|
|
+ // searchKey: this.key_input
|
|
|
+ // })
|
|
|
+ let data = {
|
|
|
+ // pageNum: page,
|
|
|
+ // pageSize: 10,
|
|
|
+ type: '',
|
|
|
+ finish: this.tabIndex,
|
|
|
+ orderSn: '',
|
|
|
+ searchKey: ''
|
|
|
+ }
|
|
|
+ let exec = await this.$http({
|
|
|
+ method: 'post',
|
|
|
+ url: `/manager/invoice/exportInvoiceList`,
|
|
|
+ data: data,
|
|
|
+ responseType: 'arraybuffer'
|
|
|
+ })
|
|
|
+ try {
|
|
|
+ let blob = new Blob([exec], { type: 'application/vnd.ms-excel' })
|
|
|
+ let href = URL.createObjectURL(blob)
|
|
|
+ console.log(href)
|
|
|
+ // location.href = url
|
|
|
+
|
|
|
+ // 谷歌浏览器 创建a标签 添加download属性下载
|
|
|
+ const downloadElement = document.createElement('a')
|
|
|
+ downloadElement.href = href
|
|
|
+ downloadElement.target = '_blank'
|
|
|
+ downloadElement.download = new Date().getTime() + '.xls'
|
|
|
+ document.body.appendChild(downloadElement)
|
|
|
+ downloadElement.click() // 点击下载
|
|
|
+ document.body.removeChild(downloadElement) // 下载完成移除元素
|
|
|
+ window.URL.revokeObjectURL(href) // 释放掉blob对象
|
|
|
+ } catch (e) {
|
|
|
+ console.error(e)
|
|
|
+ }
|
|
|
+ this.fullscreenLoading = false
|
|
|
+ }).catch((err) => {
|
|
|
+ console.log(err.message)
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '导出失败'
|
|
|
+ })
|
|
|
+ this.fullscreenLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
_exportExcelForOrder () {
|
|
|
let date1, date2, userName, expressNum, orderNum
|
|
|
this.date1 = this.searchDate ? this.searchDate[0] : ''
|
|
|
this.date2 = this.searchDate ? this.searchDate[1] : ''
|
|
|
- date1 = this.date1 ? (this.date1 + ' 00:00:00') : ''
|
|
|
- date2 = this.date2 ? (this.date2 + ' 23:59:59') : ''
|
|
|
+ date1 = this.date1 ? this.date1 + ' 00:00:00' : ''
|
|
|
+ date2 = this.date2 ? this.date2 + ' 23:59:59' : ''
|
|
|
|
|
|
this.userName = userName = this.searchPhone || ''
|
|
|
this.expressNum = expressNum = this.searchExpressNum || ''
|
|
|
this.orderNum = orderNum = this.searchOrderNumber || ''
|
|
|
|
|
|
let data = {
|
|
|
- 'type': this.status,
|
|
|
- 'startDate': date1,
|
|
|
- 'endDate': date2,
|
|
|
- 'orderSn': orderNum,
|
|
|
- 'phoneNum': userName,
|
|
|
- 'expressNum': expressNum
|
|
|
+ type: this.status,
|
|
|
+ startDate: date1,
|
|
|
+ endDate: date2,
|
|
|
+ orderSn: orderNum,
|
|
|
+ phoneNum: userName,
|
|
|
+ expressNum: expressNum
|
|
|
}
|
|
|
this.fullscreenLoading = true
|
|
|
|
|
@@ -476,43 +628,48 @@ export default {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
- }).then(async () => {
|
|
|
- let exec = await this.$http({
|
|
|
- methods: 'get',
|
|
|
- url: `/manager/order/export?type=${this.status}&startDate=${date1}&endDate=${date2}&orderSn=${orderNum}&phoneNum=${this.userName}&expressNum=${expressNum}`,
|
|
|
- responseType: 'arraybuffer'
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ let exec = await this.$http({
|
|
|
+ methods: 'get',
|
|
|
+ url: `/manager/order/export?type=${this.status}&startDate=${date1}&endDate=${date2}&orderSn=${orderNum}&phoneNum=${this.userName}&expressNum=${expressNum}`,
|
|
|
+ // url: `/manager/order/export?type=${this.tabIndex}`,
|
|
|
+ // url: `/manager/invoice/exportInvoiceList?type=${this.tabIndex}`,
|
|
|
+ responseType: 'arraybuffer'
|
|
|
+ })
|
|
|
+
|
|
|
+ try {
|
|
|
+ let blob = new Blob([exec], { type: 'application/vnd.ms-excel' })
|
|
|
+ let href = URL.createObjectURL(blob)
|
|
|
+ console.log(href)
|
|
|
+ // location.href = url
|
|
|
+
|
|
|
+ // 谷歌浏览器 创建a标签 添加download属性下载
|
|
|
+ const downloadElement = document.createElement('a')
|
|
|
+ downloadElement.href = href
|
|
|
+ downloadElement.target = '_blank'
|
|
|
+ downloadElement.download = new Date().getTime() + '.xls'
|
|
|
+ document.body.appendChild(downloadElement)
|
|
|
+ downloadElement.click() // 点击下载
|
|
|
+ document.body.removeChild(downloadElement) // 下载完成移除元素
|
|
|
+ window.URL.revokeObjectURL(href) // 释放掉blob对象
|
|
|
+ } catch (e) {
|
|
|
+ console.error(e)
|
|
|
+ }
|
|
|
+ this.fullscreenLoading = false
|
|
|
})
|
|
|
-
|
|
|
- try {
|
|
|
- let blob = new Blob([exec], {type: 'application/vnd.ms-excel'})
|
|
|
- let href = URL.createObjectURL(blob)
|
|
|
- console.log(href)
|
|
|
- // location.href = url
|
|
|
-
|
|
|
- // 谷歌浏览器 创建a标签 添加download属性下载
|
|
|
- const downloadElement = document.createElement('a')
|
|
|
- downloadElement.href = href
|
|
|
- downloadElement.target = '_blank'
|
|
|
- downloadElement.download = new Date().getTime() + '.xls'
|
|
|
- document.body.appendChild(downloadElement)
|
|
|
- downloadElement.click() // 点击下载
|
|
|
- document.body.removeChild(downloadElement) // 下载完成移除元素
|
|
|
- window.URL.revokeObjectURL(href) // 释放掉blob对象
|
|
|
- } catch (e) {
|
|
|
- console.error(e)
|
|
|
- }
|
|
|
- this.fullscreenLoading = false
|
|
|
- }).catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消导出'
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消导出'
|
|
|
+ })
|
|
|
+ this.fullscreenLoading = false
|
|
|
})
|
|
|
- this.fullscreenLoading = false
|
|
|
- })
|
|
|
},
|
|
|
async _getOrderDetail (row) {
|
|
|
console.log('row---------', row)
|
|
|
this.invoiceImg = row.einvoice
|
|
|
+
|
|
|
// this.fullscreenLoading = true
|
|
|
// let data = (await this.$http.post('/manager/order/detail', {orderId: row.id})).data
|
|
|
// let temp = this.orders.find(item => item.id === row.id)
|
|
@@ -550,18 +707,17 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-@import url('./style.css');
|
|
|
+@import url("./style.css");
|
|
|
.el-icon-s-flag {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
-
|
|
|
</style>
|
|
|
|
|
|
<style type="text/css">
|
|
|
.el-table__expand-icon--expanded {
|
|
|
transform: rotate(0) !important;
|
|
|
}
|
|
|
-.el-table__expand-icon>i {
|
|
|
+.el-table__expand-icon > i {
|
|
|
display: none !important;
|
|
|
}
|
|
|
|