提交 2261701c authored 作者: PC-20210205TDZC\Administrator's avatar PC-20210205TDZC\Administrator

Merge branch 'dev_hxz' of http://120.27.146.32:8888/wangfulong/shop-new into dev_hxz

import request from '@/utils/request' import request from '@/utils/request'
// 查询bankcard列表 // 查询bankcard列表
export function listBankcard(query) { // export function listBankcard(query) {
return request({ // return request({
url: '/system/bankcard/list', // url: '/system/bankcard/list',
method: 'get', // method: 'get',
params: query // params: query
}) // })
} // }
// 查询银行名称列表 // 查询银行名称列表
export function listBankname(query) { // export function listBankname(query) {
// return request({
// url: '/system/bankcard/getBankList',
// method: 'get',
// params: query
// })
// }
// 查询bankcard详细
// export function getBankcard (id) {
// return request({
// url: '/system/bankcard/edit?id='+id,
// method: 'get'
// })
// }
// 修改bankcard
// export function updateBankcard(data) {
// return request({
// url: '/system/bankcard/edit',
// method: 'post',
// data: data
// })
// }
// 删除bankcard
// export function delBankcard(ids) {
// return request({
// url: '/system/bankcard/delete',
// method: 'delete',
// data:{id:ids}
// })
// }
// 我的资产 页面 所有数据
export function getMyAssetListData(data) {
return request({
url: '/local/assets/list',
method: 'post',
data: data
})
}
// 获取 主体信息
export function getOrganizationData(query) {
return request({ return request({
url: '/system/bankcard/getBankList', url: '/local/getOrganization',
method: 'get', method: 'get',
params: query params: query
}) })
} }
// 查询bankcard详细 // 新增 银行卡 信息
export function getBankcard (id) { export function addBankcardData(data) {
return request({ return request({
url: '/system/bankcard/edit?id='+id, url: '/system/bank/add',
method: 'get' method: 'post',
data: data
}) })
} }
// 编辑 银行卡 信息
export function editBankcardData(data) {
return request({
url: '/system/bank/update',
method: 'post',
data: data
})
}
// 新增bankcard // 获取 银行卡 详情
export function addBankcard(data) { export function getBankDetailsData(data) {
return request({ return request({
url: '/system/bankcard/add', url: '/system/bank/detail',
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 修改bankcard // 获取商户银行卡列表
export function updateBankcard(data) { export function getBankcardListData(data) {
return request({ return request({
url: '/system/bankcard/edit', url: '/system/bank/list',
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 删除bankcard // 账户 删除
export function delBankcard(ids) { export function delBankcardData(data) {
return request({ return request({
url: '/system/bankcard/delete', url: '/system/bank/delete',
method: 'delete', method: 'post',
data:{id:ids} data: data
}) })
} }
// 收支明细 列表
export function getBalanceList(data) {
return request({
url: '/local/asset/getSellerBalanceLogList',
method: 'post',
data: data
})
}
// 提现记录 列表
export function getWithdrawData(data) {
return request({
url: '/system/withdrawlog/list',
method: 'post',
data: data
})
}
// 提现记录 详情
export function getWithdrawlogDetailsData(data) {
return request({
url: '/system/withdrawlog/info',
method: 'post',
data: data
})
}
// 导出商品明细
export function exportGoodsDetailsData(data) {
return request({
url: '/system/withdrawlog/exportWithdrawOrderGoods',
method: 'post',
data: data
})
}
// 获取 所有物流信息
export function getExpressListData(query) {
return request({
url: '/system/order/expressList',
method: 'get',
params: query
})
}
// 上传 发票 图片
export function upLoadImg (data) {
return request({
url: '/system/goodsNew/uploadImage',
method: 'post',
data: data
});
}
// 补充发票
export function addInvoiceData (data) {
return request({
url: '/system/withdrawlog/updateInvoice',
method: 'post',
data: data
});
}
// 获取验证码
export function getCheckCodeData(data) {
return request({
url: '/system/withdrawlog/getCheckCode',
method: 'post',
data: data
})
}
// 提交 提现申请
export function applyWithdraw(data) {
return request({
url: '/system/withdrawlog/applyWithdraw',
method: 'post',
data: data
})
}
import request from '@/utils/request'
/** 我的资产 */
// 获取 银行卡 信息
export function getBankcardListData(query) {
return request({
url: '/system/asset/list11',
method: 'get',
params: query
})
}
...@@ -99,51 +99,52 @@ export function delOrder(ids) { ...@@ -99,51 +99,52 @@ export function delOrder(ids) {
}) })
} }
// 订单导出-按搜索条件,全部导出 // 批量 去发货
export function exportOrder(query) { export function deliveryOrder(data) {
return request({ return request({
url: '/system/order/unSendOrderGoodsExport', url: '/system/order/orderListSend',
method: 'get', method: 'post',
params: query data: data
}) })
} }
// old
// export function exportOrder(query) {
// return request({
// url: '/system/order/getOrderListExport',
// method: 'get',
// params: query
// })
// }
// 批量发货 // 批量 补单发货
export function deliveryOrder(data) { export function deliveryOrderAgain(data) {
return request({ return request({
url: '/system/order/batchDeliveryGoods', url: '/system/order/orderListAllSend',
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 订单 右上角的 批量发货接口 /system/order/batchDeliveryGoodsOut 老接口 // 导出导入-批量发货
export function deliveryOrderExport(data) {
// 批量 去发货
export function deliveryOrderOne(data) {
return request({ return request({
url: '/system/order/orderListSend', url: '/system/order/batchDeliveryGoods',
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 批量 补单发货 // 订单导出-全部订单-页签
export function deliveryOrderTwo(data) { export function exportOrder(query) {
return request({ return request({
url: '/system/order/orderListAllSend', url: '/system/order/getOrderListExport',
method: 'post', method: 'get',
data: data params: query
}) })
} }
// 【待发货】-状态的 订单导出
export function exportUnSendOrderGoodsData(query) {
return request({
url: '/system/order/unSendOrderGoodsExport',
method: 'get',
params: query
})
}
// //
// // 单商品订单 补单发货 // // 单商品订单 补单发货
// export function toReissueOrderData(data) { // export function toReissueOrderData(data) {
......
...@@ -2,29 +2,84 @@ ...@@ -2,29 +2,84 @@
<div class="app-container"> <div class="app-container">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<p style="font-size: 18px">结算流水</p> <el-form class="form-params" :model="queryParams" :inline="true" size="small">
<el-form-item label="关联订单单号:" prop="order_sn">
<el-input
v-model="queryParams.order_sn"
placeholder="请输入关联订单单号"
clearable
style="width:230px"
/></el-form-item>
<el-form-item label="查询时间" prop="searchTime">
<el-date-picker
v-model="queryParams.searchTime"
type="daterange"
align="left"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="变动类型" prop="change_type">
<el-select v-model="queryParams.change_type" placeholder="全部类型" clearable style="width:130px">
<el-option label="全部类型" :value="0"></el-option>
<el-option label="增加" :value="1" ></el-option>
<el-option label="减少" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</div> </div>
<el-table v-loading="loading" :height="tableHeight" :data="assetList"> <el-table v-loading="loading" :height="tableHeight" :data="balanceList">
<el-table-column label="ID" align="center" prop="Id"/> <!-- <template slot-scope="scope">-->
<el-table-column label="流水订单号" align="center" prop="BalanceSn"/> <!-- <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>-->
<el-table-column label="变动金额" align="center" prop="ChangeMoney"/> <!-- </template>-->
<el-table-column label="变动类型" align="center" :formatter="formatType" prop="ChangeType"/> <el-table-column label="序号" align="center" width="55">
<el-table-column label="时间" align="center" :formatter="formatTime" prop="AddTime"/> <template slot-scope="scope">
<el-table-column label="描述" align="center" prop="Des"/> <span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="流水订单号" align="center" prop="balance_sn"></el-table-column>
<el-table-column label="变动金额" align="center" prop="change_money" width="130">
<template slot-scope="scope">
<span>{{ scope.row.change_money / 100 }}</span>
</template>
</el-table-column>
<el-table-column label="变动类型" align="center" prop="change_type" width="130">
<template slot-scope="scope">
<span v-if="scope.row.change_type == 1">增加</span>
<span v-if="scope.row.change_type == 2">减少</span>
</template>
</el-table-column>
<el-table-column label="变动描述" align="center" prop="des"></el-table-column>
<el-table-column label="变动时间" align="center" :formatter="formatTime" prop="add_time"></el-table-column>
<el-table-column label="关联订单单号" align="center" prop="links_des"></el-table-column>
</el-table> </el-table>
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <!-- 分页 -->
@pagination="getList"/> <div class="footer_pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[20, 40, 60, 80, 100]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import { import { getBalanceList } from '@/api/module/bankcard'
listAsset,
getAsset,
delAsset,
addAsset,
updateAsset
} from '@/api/module/asset'
import { import {
dateFormat dateFormat
} from '@/utils' } from '@/utils'
...@@ -32,25 +87,24 @@ ...@@ -32,25 +87,24 @@
name: "asset", name: "asset",
data() { data() {
return { return {
loading: false,
fullHeight: 0, fullHeight: 0,
tableHeight: 0, tableHeight: 0,
loading: false, // 遮罩层
ids: [], // 选中数组
total: 0, // 总条数
assetList: [], // 商户余额变动日志表格数据
title: "", // 弹出层标题
open: false, // 是否显示弹出层
queryParams: { // 查询参数 queryParams: { // 查询参数
pageNum: 1, sellerId: 0,
pageSize: 10, order_sn: '',
sellerId: 0 searchTime: [],
change_type: ''
}, },
form: {}, // 表单参数 total: 0,
rules: {} // 表单校验 currentPage: 1,
pageSize: 20,
balanceList: [],
}; };
}, },
created() { created() {
this.queryParams.sellerId = this.$store.state.user.sellerid // this.queryParams.sellerId = this.$store.state.user.sellerid
/** 查询 收支明细 列表 */
this.getList(); this.getList();
this.$nextTick(() => { this.$nextTick(() => {
this.fullHeight = document.getElementsByClassName('box-card')[0].clientHeight this.fullHeight = document.getElementsByClassName('box-card')[0].clientHeight
...@@ -59,23 +113,71 @@ ...@@ -59,23 +113,71 @@
watch: { watch: {
fullHeight(val) { fullHeight(val) {
let formHeight = document.getElementsByClassName('clearfix')[0].clientHeight let formHeight = document.getElementsByClassName('clearfix')[0].clientHeight
this.tableHeight = val - formHeight - 120; this.tableHeight = val - formHeight - 100;
} }
}, },
methods: { methods: {
formatType(row) { /** 列表查询 */
var types = row.ChangeType getList() {
var optDes = '' let params = {
if (types == 1) { page: this.currentPage,
optDes = "增加" limit: this.pageSize,
} else if (types == 2) { }
optDes = "减少"
if(this.queryParams.order_sn != '') {
params['order_sn'] = this.queryParams.order_sn
}
if(this.queryParams.change_type == '') {
params['change_type'] = 0
}else {
params['change_type'] = this.queryParams.change_type
}
if( this.queryParams.searchTime && this.queryParams.searchTime.length == 2) {
params['start_time'] = new Date(this.queryParams.searchTime[0]).getTime() / 1000;
params['end_time'] = new Date(this.queryParams.searchTime[1]).getTime() / 1000;
}
getBalanceList(params).then(res => {
if(res.code == 1) {
this.balanceList = res.data.list;
this.total = res.data.count;
}else {
let msg = res.message ? res.message : '查询失败'
this.$message({type: 'error', message: msg});
}
});
},
/** 重置 搜索条件 */
resetQuery() {
this.queryParams = { // 查询参数
sellerId: 0,
order_sn: '',
searchTime: [],
change_type: ''
} }
return optDes this.currentPage = 1
this.pageSize = 20
this.getList();
},
handleSizeChange(val) {
this.pageSize = val
this.getList()
},
handleCurrentChange(val) {
this.currentPage = val
this.getList()
}, },
//格式化时间 /** 输入搜索条件后,enter 查询 暂时未用 */
handleQuery() {
},
/** 时间格式化 */
formatTime(row) { formatTime(row) {
let Time = row.AddTime; let Time = row.add_time;
let newtime = ""; let newtime = "";
if (Time > 0) { if (Time > 0) {
newtime = dateFormat(Time * 1000, "Y-m-d H:i:s"); newtime = dateFormat(Time * 1000, "Y-m-d H:i:s");
...@@ -85,27 +187,23 @@ ...@@ -85,27 +187,23 @@
//格式化价格 //格式化价格
formatMoney(row) { formatMoney(row) {
var nm = 0; var nm = 0;
var money = row.ChangeMoney; var money = row.change_money;
if (money > 0) { if (money > 0) {
nm = money / 1000 nm = money / 1000
} }
return nm return nm
}, },
/** 查询商户余额变动日志列表 */
getList() {
listAsset(this.queryParams).then(res => {
this.assetList = res.data.list;
this.total = res.data.total;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
} //methods结束 } //methods结束
}; };
</script> </script>
<style scoped> <style scoped>
.form-params .el-form-item {
margin: 10px 0 10px 10px;
}
/* 分页 */
.footer_pagination {
text-align: center;
margin-top: 15px;
}
</style> </style>
<template>
<div class="app-container">
<el-card class="box-card explain">
<div class="pre-details">
<p>1、账户资产说明</p>
<p>(1)、当前余额:是指您当前账户里面的余额,该部分余额包含【可提现余额】和【提现中的金额】</p>
<p>(2)、可提现余额:是指您可以操作提现的余额</p>
<p>(3)、提现中的金额:是指您当前进行中的提现金额,提现中的金额在完成打款前会暂时冻结,直到打款完成</p>
<p>三者的关系:当前余额=可提现余额+提现中的金额</p>
</div>
<div class="pre-details">
<p>2、相关名词说明</p>
<p>(1)、结算:指订单完成并过售后期,订单金额结算到您的可提现余额账户中</p>
<p>(2)、提现:指您操作提现,将可提现余额账户中的钱提现至您的银行卡中</p>
</div>
<div class="pre-details">
<p>3、提现账户管理</p>
<p>(1)、提现账户必须为企业对公账户,且对公账户名称与认证的主体一致</p>
<p>(2)、提现账户不支持个人账户,不支持支付宝账户</p>
<p>(3)、对公账户最多只能添加三个</p>
</div>
<div class="pre-details">
<p>4、提现要求</p>
<p>(1)、提供正确、合规的企业对公账户</p>
<p>(2)、提供提现金额对应订单商品的发票及明细</p>
<p>(3)、提现金额最低要求为100元,如果您的可提现账户余额不足100元,则暂无法提现</p>
</div>
<div class="pre-details">
<p>5、订单结算</p>
<p>(1)、订单自发货日期,10天后自动确认收货,15天后过售后期,订单金额自动结算到可提现余额账户中</p>
<p>(2)、售后中的订单、失效订单等订单不会结算</p>
</div>
<div class="pre-details">
<p>6、操作提现</p>
<p>(1)、在【我的资产】中,点击提现按钮,根据提示验证支付密码及手机验证码,验证通过后即可提现</p>
<p>(2)、操作提现时,提现的金额为全部的可提现余额,不允许手动输入金额</p>
<p>(3)、操作提现时,会产生提现手续费,手续费收取标准请参照本文第5条</p>
<p>(4)、实际到账金额=提现金额-提现手续费,请以实际到账为准</p>
</div>
<div class="pre-details">
<p>7、提现周期</p>
<p>(1)、工作日当日12:00之前提交的提现,1-5个工作日内安排打款,工作日当日12:00之后提现的金额,次日开始,1-5个工作日安排打款,节假日顺延</p>
<p>(2)、银行卡到账时间:打款后0-2个工作日到账 (具体请咨询所属银行)</p>
</div>
<div class="pre-details">
<p>8、提现收续费收取标准</p>
<p>
<img width="712px" src="@/assets/image/withdraw-charges.png" alt="">
</p>
</div>
<div class="pre-details">
<p>9、提现流程</p>
<p>
<img width="712px" src="@/assets/image/withdraw-process.png" alt="">
</p>
</div>
<div class="pre-details">
<p>10、发票信息</p>
<p>(1)、发票抬头:北京胜天半子科技有限公司</p>
<p>(2)、纳税人识别号:911016513F1ECWX</p>
</div>
<div class="pre-details">
<p>11、联系我们</p>
<p>(1)、客服电话:4000-188-199</p>
<p>(2)、公司地址:北京市丰台区诺德中心一期四号楼21层</p>
</div>
</el-card>
</div>
</template>
<script>
export default {
name: "Explain",
data() {
return {}
}
}
</script>
<style scoped>
/deep/.explain .el-card__body {
height: 100%;
/*padding: 30px 20px;*/
overflow: auto;
color: #333;
font-size: 14px;
}
.pre-details {
margin: 40px 50px;
}
</style>
<template>
<div class="app-container">
<el-card>
<!-- 商品信息 -->
<div class="card-header-custom">
<div class="card-header-title">
<span class="blue-block blue-block-goods-title"></span>账号资产
</div>
<div class="card-header-handle">
<el-button plain type="primary" size="small" @click="explainWithdrawal">提现说明</el-button>
<el-button plain type="primary" size="small" @click="goToWithdrawlog">提现记录</el-button>
</div>
</div>
<div class="row-flex-center">
<div class="current-balance">
<dl class="balance-dl">
<dt>当前余额(元)</dt>
<dd>{{ currentBalance }}</dd>
</dl>
<p class="in-details-balance" @click="goToBalance">收支明细</p>
</div>
<div class="withdrawal-balance">
<dl class=" balance-dl dl-border">
<dt>可提现余额(元)</dt>
<dd>{{ withdrawalBalance }}</dd>
</dl>
</div>
<div class="withdrawal-progress">
<dl class=" balance-dl">
<dt>提现中的金额(元)</dt>
<dd>{{ withdrawalProgress }}</dd>
</dl>
</div>
</div>
<div class="row-flex-center">
<el-button type="primary" size="small" style="padding: 10px 30px; margin: 20px 0 40px;" @click="handleWithdraw">提 现</el-button>
</div>
<!-- 账号管理 -->
<div class="card-header-custom">
<div class="card-header-title">
<span class="blue-block blue-block-goods-title"></span>账户管理
</div>
</div>
<div class="row-flex-space-around">
<div class="card-con" v-for="(item,index) in bankcardList" :key="index">
<div class="card-info-con">
<div class="card-name">{{ item.bank_name }}</div>
<div class="bank-detail">
<p>对公账户名称:{{ item.corporate_account_name }}</p>
<p>银行名称:{{ item.bank_name }}</p>
<p>对公银行账号:{{ item.bank_account_sn }}</p>
<p>开户行(支行):{{ item.bank_branch_name }}</p>
</div>
</div>
<div class="card-info-handle">
<el-button plain type="primary" size="mini" style="padding: 10px 30px; margin: 20px 40px 40px 0;" @click="editBankcard(item.id)">编 辑</el-button>
<el-button plain type="primary" size="mini" style="padding: 10px 30px; margin: 20px 0 40px;" @click="delBankcard(item.id)">删 除</el-button>
</div>
</div>
<div v-if="bankcardList.length < 3" class="hh-card-con" :class="{ 'only-add-con' : bankcardList.length == 0 ? true: false }">
<div class="add-card-con">
<div class="add-card-btn" @click="addBankcard">+</div>
</div>
</div>
</div>
<!-- <div class="row-flex-center">-->
<!-- <el-button type="primary" size="small" style="padding: 10px 30px; margin: 20px 40px 40px 0;">编 辑</el-button>-->
<!-- <el-button type="primary" size="small" style="padding: 10px 30px; margin: 20px 0 40px;">删 除</el-button>-->
<!-- </div>-->
</el-card>
<!-- 添加、编辑 银行卡 信息 -->
<el-dialog
:title="bankcardTitle"
:visible.sync="addBankcardInfoDialog"
:before-close="cancelSubmitBankcard"
center
>
<el-form ref="bankcardForm" :model="bankcardForm" :rules="bankcardRule" size="small" label-width="180px">
<el-form-item label="账号类型:">
<el-input type="text" placeholder="银行对公账户" :disabled="true" style="width: 70%;"></el-input>
<p class="withdraw-tip">
根据要求,提现仅支持公对公账户
</p>
</el-form-item>
<el-form-item label="银行名称:" prop="bank_name" >
<el-select v-model="bankcardForm.bank_name" placeholder="请选择" style="width: 70%;">
<el-option
v-for="item in bankOptions"
:key="item.code"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="对公账户名称:" style="width:100%">
<el-input v-model="bankAccountName" placeholder="对公账户名称,不能输入和修改" :disabled="true" style="width: 70%"></el-input>
<p class="withdraw-tip">
银行卡必须为对公账户,且与提交的公司名称相一致,不允许修改
</p>
</el-form-item>
<el-form-item label="开户行(支行):" prop="bank_branch_name">
<el-input v-model="bankcardForm.bank_branch_name" placeholder="请输入开户行" style="width: 70%"></el-input>
</el-form-item>
<el-form-item label="对公银行账号:" prop="bank_account_sn">
<el-input v-model="bankcardForm.bank_account_sn" placeholder="请输入快递单号" style="width: 70%"></el-input>
</el-form-item>
<el-form-item>
<span class="withdraw-tip">温馨提示:所有项均为必填项,请正确填写相关信息,信息填写错将导致提现无法成功</span>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="submitBankcard">确 定</el-button>
<el-button size="small" @click="cancelSubmitBankcard">取 消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getMyAssetListData,getOrganizationData, getBankDetailsData,getBankcardListData, addBankcardData,editBankcardData ,delBankcardData } from '@/api/module/bankcard'
export default {
name: "Index",
data() {
return {
seller_id: '',
currentBalance: 0,
withdrawalBalance: 0,
withdrawalProgress: 0,
bankcardList: [],
addBankcardInfoDialog: false,
bankcardTitle: '',
bankAccountName: '', // 主体信息 公司名称
bankcardForm: {
bank_name: '',
bank_branch_name: '',
bank_account_sn: '',
},
bankcardRule: {
bank_name: [{required: true,message: '银行名称不能为空',trigger: 'change'}],
bank_branch_name: [{required: true,message: '开户行支行不能为空',trigger: 'blur'}],
bank_account_sn: [{ required: true,message: '银行账号不能为空',trigger: 'blur'}]
},
bankOptions: [], // 银行卡列表
indexId: 0,
} // return end
},// data end
created() {
/** 获取 seller_id*/
this.seller_id = this.$store.state.user.sellerid;
/** 我的资产 所有数据 */
this.getMyAssetList()
/** 获取 银行卡列表 */
this.getBankcardList()
/** 获取主体信息 */
this.getOrganization();
},
methods: {
/** 我的资产 所有数据 */
getMyAssetList() {
getMyAssetListData( {seller_id:this.seller_id} ).then(res=> {
if(res.code == 1 && res.data) {
// 账号资产
if(res.data.account_info ) {
this.withdrawalBalance = Number(res.data.account_info.new_balance) / 100;
this.withdrawalProgress = Number(res.data.account_info.new_frozen_money) / 100;
this.currentBalance = this.add(this.withdrawalBalance,this.withdrawalProgress);
}
// 账户管理
if(res.data.bank_list) {
this.bankcardList = res.data.bank_list;
}
}else {
let msg = res.message ? res.message : '获取用户列表失败'
this.$message({type:'error',message: msg});
}
});
},
/** 获取主体信息 */
getOrganization() {
getOrganizationData().then(res=> {
if(res.code == 1 && res.data) {
this.bankAccountName = res.data.organization_name;
}
});
},
/** 编辑 银行卡信息 */
editBankcard(id) {
this.bankcardTitle = '编辑账户'
this.indexId = id;
getBankDetailsData({ id: id }).then(res=> {
if(res.code == 1 && res.data) {
this.addBankcardInfoDialog = true;
if(res.data.bank_name) {
for(let i = 0; i < this.bankOptions.length; i++) {
if(res.data.bank_name == this.bankOptions[i].name) {
this.bankcardForm.bank_name = this.bankOptions[i].code;
break
}
}
}
this.bankcardForm.bankAccountName = res.data.corporate_account_name;
this.bankcardForm.bank_branch_name = res.data.bank_branch_name;
this.bankcardForm.bank_account_sn = res.data.bank_account_sn;
}else {
let msg = res.message ? res.message : '获取银行卡信息失败'
this.$message({type:'error',message: msg});
}
});
},
/** 删除 银行卡信息 */
delBankcard(id) {
const indexId = id;
this.$confirm('确定要删除该账户信息吗?','警告',{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async ()=> {
let delResult = await delBankcardData({id: indexId});
console.log('删除结果',delResult);
if (delResult.code == 1) {
this.$message({type:'success',message:'删除成功'});
this.getMyAssetList();
}
if (delResult.code == 0) {
let msg = delResult.message ? delResult.message : '删除失败'
this.$message({type:'error',message: msg });
}
}).catch(()=> {});
},
/** 添加 银行卡信息 */
addBankcard() {
this.bankcardTitle = '添加账户'
this.addBankcardInfoDialog = true;
this.indexId = 0;
},
/** 提交 添加银行卡信息 */
submitBankcard() {
let params = {
bank_name: '',
bank_branch_name: this.bankcardForm.bank_branch_name,
bank_account_sn: this.bankcardForm.bank_account_sn
}
for (let i = 0; i < this.bankOptions.length; i++) {
if (this.bankcardForm.bank_name == this.bankOptions[i].code) {
params.bank_name = this.bankOptions[i].name
break
}
}
this.$refs.bankcardForm.validate((valid)=> {
if (valid) {
// 新增
if (this.indexId == 0) {
params['seller_id'] = this.seller_id;
addBankcardData(params).then(res=> {
if(res.code == 1) {
this.$message({type:'success',message: '新增成功'});
this.resetAddBankcardForm();
this.addBankcardInfoDialog = false;
this.getMyAssetList(); // 更新数据
}else {
this.$message({type:'error',message: res.message ? res.message : '新增失败' });
}
});
}else {
params['id'] = this.indexId
editBankcardData(params).then(res=> {
if(res.code == 1) {
this.$message({type:'success',message: '修改成功'});
this.resetAddBankcardForm();
this.addBankcardInfoDialog = false;
this.getMyAssetList(); // 更新数据
}else {
this.$message({type:'error',message: res.message ? res.message : '修改失败' });
}
});
}
} // valid end
});
},
/** 取消 提交 添加银行卡信息*/
cancelSubmitBankcard() {
this.resetAddBankcardForm();
this.addBankcardInfoDialog = false;
},
/** 初始化 添加 银行卡 数据 */
resetAddBankcardForm() {
this.$refs['bankcardForm'].resetFields();
},
/** 提现 操作 */
handleWithdraw() {
this.$router.push({ path: "/system/asset/withdraw" });
},
/** 收支明细 跳转 */
goToBalance() {
this.$router.push({ path: "/system/asset/balance" });
},
/** 提现记录*/
goToWithdrawlog() {
this.$router.push({ path: "/system/asset/withdrawlog" });
},
/** 提现说明 */
explainWithdrawal() {
this.$router.push({ path: "/system/asset/explain" });
},
/** 获取 银行列表 */
getBankcardList() {
getBankcardListData().then(res=> {
if(res.code == 1 && res.data) {
this.bankOptions = res.data
}else {
let msg = res.message ? res.message : '获取银行列表失败'
this.$message({type:'error',message: msg});
}
});
},
// 自定义高精度浮点数运算
// 加法
add(arg1, arg2) {
let r1, r2, m, result;
try {
//取小数位长度
r1 = arg1.toString().split(".")[1].length;
r2 = arg2.toString().split(".")[1].length;
} catch (e) {
r1 = 0;
r2 = 0;
}
m = Math.pow(10, Math.max(r1, r2)); //计算因子
result = (arg1 * m + arg2 * m) / m;
result = result.toFixed(2);
return result;
},
// 减法
minus(arg1, arg2) {
return this.add(arg1, -arg2);
},
} // methods end
}
</script>
<style scoped>
.app-container {
overflow: auto;
}
/* el-card title hxz 样式统一 start */
.card-header-custom {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #F6F6F8;
padding-bottom: 15px;
}
.card-header-title {
line-height: 24px;
font-size: 18px;
color: #000;
font-weight: bold;
}
.blue-block {
display: inline-block;
width: 5px;
height: 24px;
background: #3A84FF;
margin: 0 9px 0 0;
border-radius: 2px;
vertical-align: bottom;
}
.current-balance,.withdrawal-balance,.withdrawal-progress {
flex: 1;
margin: 30px 0;
background-color: #F8FBFD;
}
.current-balance {
position: relative;
}
.balance-dl {
padding: 20px 0;
margin: 20px 0;
}
.dl-border {
border-right: 2px solid #E8E7E7;
border-left: 2px solid #E8E7E7;
}
.balance-dl > dt,.balance-dl > dd {
text-align: center;
margin: 20px 0;
padding: 0;
}
.balance-dl > dt {
height: 36px;
font-size: 16px;
font-weight: bold;
color: #333333;
line-height: 36px;
padding-left: 16px;
}
.balance-dl > dd {
height: 36px;
font-size: 34px;
font-weight: bold;
color: #40A3FC;
line-height: 36px;
}
.in-details-balance {
position: absolute;
height: 20px;
line-height: 20px;
font-size: 14px;
font-weight: 400;
color: #40A3FC;
cursor: pointer;
bottom: 6px;
left: calc(50% - 26px);
}
/* el-card title hxz 样式统一 end */
.row-flex-center {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.row-flex-space-around {
display: flex;
flex-direction: row;
justify-content: start;
align-items: center;
flex-wrap: wrap;
}
.mp20 {
margin: 30px;
padding: 10px 20px;
}
.card-con {
}
.card-info-con {
width: 468px;
height: 274px;
margin: 20px;
box-shadow :0 2px 10px 0 rgba(0,0,0,0.05);
}
.hh-card-con {
width: 468px;
height: 366px;
}
.only-add-con {
margin: 20px 0;
}
.add-card-con {
width: 468px;
height: 274px;
box-shadow :0 2px 10px 0 rgba(0,0,0,0.05);
}
/*.card-con:hover {*/
/* box-shadow :0 2px 10px 0 rgba(0,0,0,0.1);*/
/*}*/
/* 点击效果 */
.checked-bankcard {
}
.card-name {
height: 60px;
line-height: 60px;
text-align: center;
color: #fff;
border-radius: 5px 5px 0px 0px;
background: #40A3FC;
}
.bank-detail {
padding: 10px 20px;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 30px;
}
.add-card-con {
background: #F8FBFD;
border: 1px dashed #D7D7D8;
border-radius: 5px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.add-card-btn {
padding: 50px;
line-height: 30px;
text-align: center;
font-size: 24px;
cursor: pointer;
color: #666;
}
.card-info-handle {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.withdraw-tip {
font-size:12px;
color: #999;
margin: 5px;
line-height: 26px;
}
</style>
<template>
<div class="app-container">
<el-card class="box-card">
<p class="card-header-tip">
提现状态:<span class="pay-status">{{ payStatusFormatter(withdrawInfo.pay_status) }}</span>
<span>如果您是电子发票,则不用填写快递公司和单号信息,需上传电子发票图片,同时将电子发票发送至电子邮箱,查看</span>
<span class="checked-email-rule" @click="isViewSendRuleDialog = true">【电子邮箱及发票发送格式】</span>
</p>
<div class="main">
<div class="card-header-title">
<span class="blue-block blue-block-goods-title"></span>提现信息
</div>
<el-row class="row-title">
<el-col :span="4" class="text-r">提现流水单号</el-col>
<el-col :span="9" class="text-l">{{ withdrawInfo.sn }}</el-col>
</el-row>
<el-row class="row-title">
<el-col :span="4" class="text-r">提现时间</el-col>
<el-col :span="9" class="text-l">{{ formatter(withdrawInfo.created_time) }}</el-col>
</el-row>
<el-row class="row-title">
<el-col :span="4" class="text-r">提现金额</el-col>
<el-col :span="9" class="text-l">{{ withdrawInfo.amount ? withdrawInfo.amount / 100 : 0 }}</el-col>
</el-row>
<el-row class="row-title">
<el-col :span="4" class="text-r">手续费</el-col>
<el-col :span="9" class="text-l">{{ withdrawInfo.service_fee ? withdrawInfo.service_fee / 100 : 0 }}</el-col>
</el-row>
<el-row class="row-title">
<el-col :span="4" class="text-r">实际到账金额</el-col>
<el-col :span="9" class="text-l">{{ withdrawInfo.real_amount ? withdrawInfo.real_amount / 100 : 0 }}</el-col>
</el-row>
<el-row class="row-title">
<el-col :span="4" class="text-r">提现至账户</el-col>
<el-col :span="9" class="text-l">{{ withdrawInfo.bank_name_all }}</el-col>
</el-row>
<el-row class="row-title">
<el-col :span="4" class="text-r">发票信息</el-col>
<el-col :span="9" class="text-l">
<el-link v-if="withdrawInfo.invoice_status == 1" :underline="false" type="primary" @click="viewInvoiceDetails">点击查看发票</el-link>
<el-link v-else disabled>发票未提交</el-link>
</el-col>
</el-row>
<div class="card-header-title">
<span class="blue-block blue-block-goods-title"></span>打款备注
</div>
<div class="remark-con">
<p v-if="payRemark">{{ payRemark }}</p>
<p v-else style="color: #555;">暂无备注</p>
</div>
</div>
<div class="footer-btn">
<el-button type="primary" @click="exportGoodsDetails" style="margin-right:20px;">导出商品明细</el-button>
<el-button @click="submitInvoiceAgain" :disabled="isSubmitInvoice">补充发票信息</el-button>
</div>
</el-card>
<!-- 电子发票 规则 -->
<el-dialog
title="电子发票发送格式"
:visible.sync="isViewSendRuleDialog"
width="40%"
center
>
<div class="view-sendemail-rule">
<p>您好,如果您是电子发票,请通过邮箱按照以下格式发送:</p>
<p><span class="span-title">标题:</span>【XXX公司】电子发票</p>
<p><span class="span-title spe-1">收件人:</span>finanical@stbz.net</p>
<p><span class="span-title">正文内容:</span>【XXX公司】电子发票</p>
<p><span class="span-title spe-1">附件:</span>电子发票</p>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="isViewSendRuleDialog = false" >取 消</el-button>
</span>
</el-dialog>
<!-- 补充发票 信息 -->
<el-dialog
title="补充发票信息"
:destroy-on-close="true"
:visible.sync="isAddInvoiceAgainDialog"
:before-close="cancelUpInvoiceImg"
width="40%"
center>
<el-form ref="addInvoiceForm" :model="addInvoiceForm" :rules="addInvoiceRule" label-width="150px" class="add-invoice-form" size="small">
<el-form-item label="快递公司:" prop="express_name">
<el-select v-model="addInvoiceForm.express_name" filterable placeholder="请选择快递公司" style="width: 80%;">
<el-option
v-for="item in expressLists"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="快递单号:" prop="express_sn">
<el-input v-model="addInvoiceForm.express_sn" placeholder="请输入快递单号" style="width: 80%;"></el-input>
</el-form-item>
<el-form-item label="发票图片:" prop="invoice_img">
<el-upload
class="avatar-uploader"
action=""
list-type="picture-card"
:http-request="uploadInvoiceImg"
:before-upload="beforeUpInvoiceImg"
:file-list="invoiceImgList"
:limit="1"
:on-exceed="limitCount1"
:before-remove ="beforeRemoveInvoiceImg"
:on-remove="removeInvoiceImg"
:on-preview="handleInvoiceImg"
>
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisibleInvoiceImg" class="dialog-img-spe">
<img width="100%" :src="dialogInvoiceImg" alt=""/>
</el-dialog>
<div class="textTip">最多上传一张图片,仅限jpg/png格式,大小限制在500kb以内</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitInvoice" size="small">确 定</el-button>
<el-button type="primary" @click="cancelUpInvoiceImg" size="small">取 消</el-button>
</span>
</el-dialog>
<!-- 查看发票 信息 -->
<el-dialog
title="发票信息"
:destroy-on-close="true"
:visible.sync="isViewInvoiceAgainDialog"
width="40%"
center>
<el-form :model="viewInvoiceForm" label-width="150px" class="add-invoice-form" size="small">
<el-form-item label="快递公司:" >
<el-input v-model="viewInvoiceForm.express_name" placeholder="请输入快递单号" disabled style="width: 80%;"></el-input>
</el-form-item>
<el-form-item label="快递单号:">
<el-input v-model="viewInvoiceForm.express_sn" placeholder="请输入快递单号" disabled style="width: 80%;"></el-input>
</el-form-item>
<el-form-item label="发票图片:">
<div v-if="viewInvoiceForm.invoice_img">
<el-image
style="width: 100px; height: 100px;border:1px solid #eee;"
:src="viewInvoiceForm.invoice_img"
:preview-src-list="viewInvoiceForm.invoiceImgList">
</el-image>
</div>
<div class="textTip">最多上传一张图片,仅限jpg/png格式,大小限制在500kb以内</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="isViewInvoiceAgainDialog = false" size="small">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getWithdrawlogDetailsData,exportGoodsDetailsData,getExpressListData ,upLoadImg, addInvoiceData } from '@/api/module/bankcard'
import {dateFormat} from '@/utils'
export default {
name: "Wddetails",
data() {
let checkPic = (rule, value, callback) => {
if(this.invoiceImgList.length > 0) {
callback();
}else if(this.invoiceImgList.length === 0) {
callback(new Error("发票图片不能为空"));
}
};
return {
withdrawId: 0,
withdrawInfo: {
pay_status: 0,
sn: '',
created_time: 0,
amount: 0,
service_fee: 0,
real_amount: 0,
bank_name: '',
bank_branch_name: '',
bank_card_id: '',
bank_name_all: '',
invoice_status: 0,
},
payRemark: '', // 打款备注
// 查看 电子发票发送格式
isViewSendRuleDialog: false,
isSubmitInvoice: false, // 是否 补充提交发票
// 补充发票
isAddInvoiceAgainDialog: false, // 补充发票信息 对话框
expressLists: [],
invoiceImgList: [],// 发票图片 file
invoiceImgBase64List: [],// 发票图片 base64格式
addInvoiceForm: {
express_name: '',
express_sn: '',
invoice_img: ''
},
addInvoiceRule: {
express_name: [{required: true,message: '物流公司名称不能为空',trigger: 'change'}],
express_sn: [{required: true,message: '快递单号不能为空',trigger: 'blur'}],
invoice_img: [{ required: true, validator: checkPic}]
},
dialogVisibleInvoiceImg: false,
dialogInvoiceImg: '',
// 查看 发票信息
isViewInvoiceAgainDialog: false,
viewInvoiceForm: {
express_name: '',
express_sn: '',
invoice_img: '',
invoiceImgList: [],
}
}
}, // data end
created() {
// 提现记录 id
this.withdrawId = Number(this.$route.query.withdrawId);
// 获取 物流公司 列表
this.getExpressList();
// 查询 提现记录 详情
this.getWithdrawlogDetails();
},
methods: {
/** 查询 提现记录 详情 */
getWithdrawlogDetails() {
const id = this.withdrawId
getWithdrawlogDetailsData({id: id}).then(res=> {
if (res.code == 1 && res.data) {
if (res.data.withdraw_info) {
this.withdrawInfo = res.data.withdraw_info;
// 提现至账户 处理
if( this.withdrawInfo.bank_card_id ) {
let strBankcardId = this.withdrawInfo.bank_card_id + '';
let Forward4 = strBankcardId.substring(0,4)
let backward4 = strBankcardId.substring(strBankcardId.length-4,strBankcardId.length)
this.withdrawInfo.bank_name_all = this.withdrawInfo.bank_name + '\u00a0\u00a0' + Forward4 + '****' + backward4;
}
// 补充发票信息 按钮 是否可以点击
this.isSubmitInvoice = this.withdrawInfo.invoice_status == 1 ? true : false;
}
// 打款备注
if(res.data.action_logs && res.data.action_logs.content) {
this.payRemark = res.data.action_logs.content;
}
}
});
},
/** 导出商品明细 */
exportGoodsDetails() {
exportGoodsDetailsData( {id: this.withdrawId} ).then(res=> {
if (res.code == 1 && res.data) {
const aLink = document.createElement('a');
aLink.href = res.data;
//aLink.download = '订单.xls'; //下载的文件名
aLink.style.display = 'none';
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink);
}else {
this.$message({type:'error',message: res.message ? res.message: '导出失败'});
}
});
},
/** 补充发票信息 */
submitInvoiceAgain() {
this.isAddInvoiceAgainDialog = true;
},
/** 上传 发票图片 数量限制 1 */
limitCount1(files, fileList) {
this.$message({message: '最多上传1张图片', type: 'warning'});
},
/** 发票图片 各种校验*/
beforeUpInvoiceImg(file) {
if (file.type !== "image/png" && file.type !== "image/jpg" && file.type != "image/jpeg") {
this.$message({
message: '上传图片格式只支持png/png格式',
type: "warning"
});
return false;
}
let isImgSize = (file.size / 1024 / 1024 / 1024) > 500;
if (isImgSize) {
this.$message({
message: '上传图片大小不能超过500kb',
type: "warning"
});
return false;
}
},
/** 上传 发票 图片 */
uploadInvoiceImg(param) {
this.getBase64(param.file).then( res => {
let result = res.split(",");
this.Base64img = result[1];
let data = {"img_data":this.Base64img};
this.invoiceImgBase64List = [] // 初始化
upLoadImg(data).then( res=> {
let urlObj = {'url': ''};
if(res.data) {
urlObj.url = res.data.image_url;
this.invoiceImgList.push(urlObj); // 展示用
this.addInvoiceForm.invoice_img = res.data.image_url // 字段无用,清除校验有用
this.invoiceImgBase64List.push( data.img_data );
this.$message({type:'success',message:'图片上传成功'});
this.$refs.addInvoiceForm.clearValidate('invoice_img');
}
});
});
},
/** 发票 删除前 */
beforeRemoveInvoiceImg(file) {
if (file.status === "success") {
return new Promise((res, rej) => {
this.$confirm(`是否删除此图片`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
return res();
}).catch(() => {
this.$message({
type: 'success',
message: '取消删除!'
});
return rej();
});
});
}
},
/** 发票图片 删除 */
removeInvoiceImg(file) {
if (file.status === "success") {
for (let i = 0; i < this.invoiceImgList.length; i++) {
if (file.uid === this.invoiceImgList[i].uid) {
this.invoiceImgList.splice(i, 1);
this.invoiceImgBase64List.splice(i, 1);
}
}
this.$message( {type: 'success', message: '删除成功!'} );
if(this.invoiceImgList.length === 0) {
this.$refs.addInvoiceForm.validateField('invoice_img')
}else {
this.$refs.addInvoiceForm.clearValidate('invoice_img');
}
}
},
/** 发票图片 预览 */
handleInvoiceImg(file) {
this.dialogInvoiceImg = file.url;
this.dialogVisibleInvoiceImg = true;
},
/** 提交 补充的发票信息 */
submitInvoice() {
let params = {
id: '',
express_company: '',
express_no: '',
invoice_img: [],
}
this.$refs.addInvoiceForm.validate((valid)=> {
if (valid) {
params.id = this.withdrawId;
params.express_company = this.addInvoiceForm.express_name;
params.express_no = this.addInvoiceForm.express_sn;
params.invoice_img = this.invoiceImgBase64List
addInvoiceData(params).then(res=> {
if(res.code == 1) {
this.$message({type:'success',message: '补充发票信息成功'});
this.isAddInvoiceAgainDialog = false;
this.resetAddInvoiceForm();
this.getWithdrawlogDetails();
}else {
this.$message({type:'success',message: res.message ? res.message : '补充发票信息失败' });
}
});
}
});
},
/** 取消 提交 补充的发票信息 */
cancelUpInvoiceImg() {
this.resetAddInvoiceForm();
this.isAddInvoiceAgainDialog = false;
},
/** 初始化 补充发票的 表单数据 */
resetAddInvoiceForm() {
this.addInvoiceForm.express_name = ''
this.addInvoiceForm.express_sn = ''
this.addInvoiceForm.invoice_img = ''
this.invoiceImgList = []
this.invoiceImgBase64List = []
},
/** 查看 发票详情 */
viewInvoiceDetails() {
this.isViewInvoiceAgainDialog = true;
if( this.withdrawInfo.express_company ) {
this.viewInvoiceForm.express_name = this.withdrawInfo.express_company
}
if( this.withdrawInfo.express_no ) {
this.viewInvoiceForm.express_sn = this.withdrawInfo.express_no
}
if( this.withdrawInfo.invoice_img_arr[0] ) {
this.viewInvoiceForm.invoice_img = this.withdrawInfo.invoice_img_arr[0]
this.viewInvoiceForm.invoiceImgList = this.withdrawInfo.invoice_img_arr
}
},
/** 获取 物流公司 列表 */
getExpressList() {
getExpressListData().then(res=> {
if (res.code == 1) {
this.expressLists = res.data.expressLists
}
});
},
/** 提现状态 格式 */
payStatusFormatter(type) {
let typeMsg = '';
if(type == 0) {
typeMsg = '打款中'
}else if (type == 1) {
typeMsg = '提现成功'
}
return typeMsg
},
/** 时间格式化 */
formatter(time) {
return dateFormat(time * 1000, 'Y-m-d H:i:s')
},
/** 图片 base64 */
getBase64(file) {
return new Promise(function (resolve, reject) {
let reader = new FileReader();
let imgResult = "";
reader.readAsDataURL(file);
reader.onload = function () {
imgResult = reader.result;
};
reader.onerror = function (error) {
reject(error);
};
reader.onloadend = function () {
resolve(imgResult);
};
});
},
}// methods end
}
</script>
<style scoped>
/deep/ .el-card__body{
height: 100%;
overflow: hidden;
}
.card-header-tip {
height: 48px;
line-height: 48px;
background: #FFF5ED;
border: 1px solid #F1914E;
font-size: 14px;
font-weight: 400;
color: #333333;
padding: 0 15px;
margin-bottom: 0;
}
.pay-status {
margin: 0 10px;
font-size: 16px;
font-weight: 600;
}
.checked-email-rule {
color: #F1914E;
cursor: pointer;
}
.main {
height: calc(100% - 130px);
overflow-y: auto;
}
.card-header-title {
line-height: 24px;
font-size: 18px;
color: #000;
font-weight: bold;
margin: 20px 0;
}
.blue-block {
display: inline-block;
width: 5px;
height: 24px;
background: #3A84FF;
margin: 0 9px 0 0;
border-radius: 2px;
vertical-align: bottom;
}
/* 提现信息 */
.row-title {
font-size: 14px;
color: #333;
}
/deep/.el-col {
border: 1px solid #eee;
padding: 0 10px;
height: 45px;
display: flex;
align-items: center;
}
.text-r {
justify-content: center;
background: #F7F8FA;
align-items: center;
}
.text-l {
justify-content: center;
align-items: center;
}
.view-sendemail-rule {
margin: 20px 20%;
}
.view-sendemail-rule > p{
line-height: 30px;
}
.span-title {
display: inline-block;
width: 100px;
text-align: left;
font-weight: 500;
}
.spe-1 {
margin-right: 7px;
}
.remark-con {
min-height: 140px;
width: 70%;
background: #F7F8FA;
border: 1px solid #E7E7EB;
margin: 0 0 20px;
font-size: 14px;
padding: 0 20px;
color: #333333;
}
.remark-con > p {
line-height: 24px;
}
.footer-btn {
width: calc(100% + 40px);
margin-left: -20px;
padding-top: 20px;
height:65px;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
box-shadow: 0 -8px 9px 1px rgba(51, 51, 51, 0.06);
}
/* 补充发票 */
.add-invoice-form {
margin: 0 40px;
}
</style>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div class="card-header-title">
<p style="font-size: 18px; float:left;">提现申请</p> <span class="blue-block blue-block-goods-title"></span>操作提现
</div>
<el-form ref="assetForm" :model="assetForm" size="small" :rules="rules" label-width="150px" class="ruleFormshop">
<el-form-item label="当前余额:">
{{ currentBalance }}
</el-form-item>
<el-form-item label="可提现金额:">
{{ withdrawalBalance }}
</el-form-item>
<el-form-item label="提现中的金额:">
{{ withdrawalProgress }}
</el-form-item>
<el-form-item label="提现至:" prop="bank_id">
<el-select v-model="assetForm.bank_id" placeholder="选择到账银行卡" style="width:420px;">
<el-option v-for="item in bankList" :key="item.id" :label="item.bank_name" :value="item.id"></el-option>
</el-select>
<span class="withdraw-tip">
您还没有账户,<span class="spe-span-a" @click="goToAddBank">去添加</span>
</span>
</el-form-item>
<el-form-item label="提现金额:">
<el-input v-model="withdrawalBalance" disabled placeholder="全部提现金额" style="width:420px;"/>
<span class="withdraw-tip">
提现金额为全部的可提现余额,手续费将从您的提现金额中扣除,以实际到账为准(开票以实际到账金额开具)
</span>
<p class="withdraw-tip-spe">当前提现手续费为:{{ chargeCount }}</p>
</el-form-item>
<el-form-item label="支付密码:" prop="pay_pass">
<el-input v-model="assetForm.pay_pass" type="password" placeholder="请输入提现密码" style="width:420px;"/>
<span class="withdraw-tip">
忘记支付密码?<span class="spe-span-a" @click="goToSetting">重新设定</span>
</span>
</el-form-item>
<el-form-item label="短信验证码:" prop="code" class="spe-code-con-item">
<el-input v-model="assetForm.code" placeholder="验证码" style="width:420px;">
<template slot="append">
<span v-show="show" @click="getCheckCode" style="padding:10px 0;">获取验证码</span>
<span v-show="!show" class="count">{{count}} s</span>
</template>
</el-input>
</el-form-item>
</el-form>
<div class="footer-btn">
<el-button type="primary" @click="submitForm" :disabled="inSureCashOut" style="margin-right:20px;">确 定</el-button>
<el-button @click="resetAssetForm">取 消</el-button>
</div> </div>
<el-row>
<el-col :span="24" class="card-box">
<!-- <span>商户信息</span> -->
<el-form ref="form" :model="form" :rules="rules" label-width="150px" class="ruleFormshop">
<el-form-item label="当前余额">
{{sellerinfo.Balance}}
</el-form-item>
<el-form-item label="提现中的金额">
{{sellerinfo.FrozenMoney}}
</el-form-item>
<el-form-item label="可提现金额">
{{drawableCash}}
</el-form-item>
<el-form-item label="手续费">
当前手续费为{{newFee}}
</el-form-item>
<el-form-item label="银行卡" prop="bank_id">
<el-select v-model="form.bank_id" placeholder="选择到账银行卡" style="width:260px;">
<el-option v-for="item in banklist" :key="item.Id"
:label="item.bank_name ? item.bank_name : item.bank_account_name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="提现金额" prop="amount">
<el-input v-model="form.amount"
@blur="onInputBlur($event)"
placeholder="提现金额大于等于100"
style="width:260px;"/>
</el-form-item>
<el-form-item label="短信验证码" prop="verifycode" class="spe-code-con-item">
<el-input v-model="form.verifycode" placeholder="验证码" style="width:260px;">
<template slot="append">
<span v-show="show" @click="getCheckCodeFn">获取验证码</span>
<span v-show="!show" class="count">{{count}} s</span>
</template>
</el-input>
</el-form-item>
<el-form-item label="支付密码" prop="pwd">
<el-input v-model="form.pwd" type="password" placeholder="请输入提现密码" style="width:260px;"/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm" :disabled="inSureCashOut">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import {getSellerInfo, getBankcardList, addWithdrawlog, getCheckCode} from '@/api/module/withdrawlog' import { getMyAssetListData, getCheckCodeData,applyWithdraw } from '@/api/module/bankcard'
export default { export default {
name: "withdrawlog", name: "withdrawlog",
...@@ -67,43 +72,55 @@ ...@@ -67,43 +72,55 @@
inSureCashOut: false, inSureCashOut: false,
count: '', count: '',
timer: null, timer: null,
//提现金额
amount: 0, chargeCount: 0, // 手续费
// 遮罩层 seller_id: 0,
loading: true, currentBalance: 0,
// 选中数组 withdrawalBalance: 0,
sellerId: 0, withdrawalProgress: 0,
sellerinfo: {}, bankList: [],
banklist: [], assetForm: {
//手续费
newFee: 0,
// 可提现金额
drawableCash: 0,
// 弹出层标题
title: "",
// 是否显示弹出层
open: true,
// 表单参数
form: {
bank_id: '', bank_id: '',
amount: '' pay_pass: '',
code: ''
}, },
// 表单校验 // 表单校验
rules: { rules: {
bank_id: [{required: true, message: "请选择要提现的银行卡", trigger: "change"}], bank_id: [{required: true, message: "请选择要提现的银行卡", trigger: "change"}],
amount: [{required: true, message: "提现金额不能为空", trigger: "blur"}], code: [{required: true, message: "短信验证码不能为空", trigger: "blur"}],
verifycode: [{required: true, message: "短信验证码不能为空", trigger: "blur"}], pay_pass: [{required: true, message: "支付密码必须填写", trigger: "blur"}]
pwd: [{required: true, message: "支付密码必须填写", trigger: "blur"}] },
}
}; };
}, },
watch: {},
created() { created() {
this.sellerId = this.$store.state.user.sellerid; /** 唯一 商家 id */
this.getList(); this.seller_id = this.$store.state.user.sellerid;
/** 我的资产 所有数据 */
this.getMyAssetList()
}, },
methods: { methods: {
//----------- /** 我的资产 所有数据 */
getMyAssetList() {
getMyAssetListData( {seller_id:this.seller_id} ).then(res=> {
if(res.code == 1 && res.data) {
// 账号资产
if(res.data.account_info ) {
this.withdrawalBalance = Number(res.data.account_info.new_balance) / 100;
this.withdrawalProgress = Number(res.data.account_info.new_frozen_money) / 100;
this.currentBalance = this.add(this.withdrawalBalance,this.withdrawalProgress);
this.chargeCount = Number(res.data.account_info.service_fee) / 100;
}
// 账户管理
if(res.data.bank_list) {
this.bankList = res.data.bank_list;
}
}else {
let msg = res.message ? res.message : '获取数据失败'
this.$message({type:'error',message: msg});
}
});
},
// 自定义高精度浮点数运算 // 自定义高精度浮点数运算
// 加法 // 加法
add(arg1, arg2) { add(arg1, arg2) {
...@@ -144,48 +161,45 @@ ...@@ -144,48 +161,45 @@
}, 1000) }, 1000)
} }
}, },
getCheckCodeFn() { /** 获取 短信验证码 */
getCheckCode() {
let numRegExp = /^[0-9]+(.[0-9]{2})?$/; let numRegExp = /^[0-9]+(.[0-9]{2})?$/;
let numberMoney = Number(this.form.amount);
let numberCash = Number(this.drawableCash);
if(this.form.bank_id === '') { if(this.assetForm.bank_id == '') {
this.$refs.form.validateField("bank_id"); this.$refs.assetForm.validateField("bank_id");
return;
}
if(this.form.amount === '') {
this.$refs.form.validateField("amount");
return; return;
} }
if(this.assetForm.pay_pass ==='') {
if(!numRegExp.test(this.form.amount)) { this.$refs.assetForm.validateField("pay_pass");
this.$message({ type: 'warning',message: '提现金额只能输入大于 0 的数字'});
return; return;
} }
if (numberMoney > numberCash) { if (this.seller_id <= 0) {
this.$message({type: 'warning',message:'提现金额不足'});
return;
} else if (numberMoney < 100) {
this.msgError("提现金额必须大于等于100");
return;
}
if (this.sellerId <= 0) {
this.msgError("商户信息错误"); this.msgError("商户信息错误");
return; return;
} }
// 倒计时效果 // 倒计时效果
this.getCode() this.getCode()
getCheckCode({sellerId: this.sellerId}).then(response => {
getCheckCodeData({seller_id: this.seller_id}).then(response => {
if (response.code == 0) { if (response.code == 0) {
this.msgSuccess(response.msg); this.msgSuccess(response.msg);
} }
}); });
},
/** 去 资产 首页 添加账户 */
goToAddBank() {
this.$router.push({ path: "/system/asset/myAsset" });
},
/** 去 设置 密码 */
goToSetting() {
this.$router.push({ path: "/system/settings/setpsd" });
}, },
// 暂时 无用
onInputBlur(event) { onInputBlur(event) {
let fee = 0.006; let fee = 0.006;
this.form.amount = event.target.value; this.form.amount = event.target.value;
...@@ -211,87 +225,23 @@ ...@@ -211,87 +225,23 @@
this.newFee = (this.form.amount * fee + 1).toFixed(2); this.newFee = (this.form.amount * fee + 1).toFixed(2);
} }
}, },
//获取商户的信息
getSellerInfoFn() {
const sellerid = this.sellerId;
getSellerInfo({sellerId: sellerid}).then(response => {
this.sellerinfo = response.data;
this.sellerinfo.Balance = response.data.Balance / 100;
this.sellerinfo.FrozenMoney = response.data.FrozenMoney / 100;
this.drawableCash = this.minus(this.sellerinfo.Balance, this.sellerinfo.FrozenMoney);
});
},
//获取商户的银行卡列表
getBankcardList() {
getBankcardList({sellerId: this.sellerId}).then(response => {
this.banklist = response.data.data;
//debugger
});
},
/** 查询商户提现列表 */
getList() {
this.getSellerInfoFn();
this.getBankcardList();
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置 // 表单重置
reset() { resetAssetForm() {
this.form = {}; this.$refs['assetForm'].resetFields();
this.resetForm("form");
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["assetForm"].validate(valid => {
if (valid) { if (valid) {
let numberMoney = Number(this.form.amount); applyWithdraw(this.assetForm).then(res => {
let numberCash = Number(this.drawableCash); if (res.code == 1) {
let numberFee = Number(this.newFee); this.getMyAssetList()
this.resetAssetForm();
// 提现金额 + 手续费 <= 可提现金额 this.$message({type: 'success',message: '提现成功'});
// add minus } else {
// 提现金额 + 手续费 this.$message({type: 'error',message: res.message ? res.message : '提现失败'});
let feeAddAmount = this.add(numberFee,numberMoney);
let isabled = Number(this.minus( numberCash, feeAddAmount) );
this.form.sellerId = this.sellerId;
// 再次校验 提现信息
if(!this.form.sellerId) {
this.$message({type: 'error',message: '商户信息有误!'});
return;
}
if(numberMoney < 100 ) {
this.$message({type: 'error',message: '提现金额不能小于100'});
return;
}
if( (numberMoney > numberCash) ) {
this.$message({type: 'error',message: '提现金额不足!'});
return;
}
if( isabled < 0 ) {
this.$message({type: 'error',message: '本次操作提现后,【当前余额】不足以支付本次提现的手续费用,请您重新输入提现金额'});
return;
}
this.form.amount = Number(this.form.amount);
// console.log(this.newFee);
// console.log(feeAddAmount,isabled);
//
// return;
addWithdrawlog(this.form).then(response => {
if (response.code === 1) {
this.msgSuccess(response.message);
this.getList();
}
else {
this.$message({type: 'error',message: response.message});
} }
}); });
} }
...@@ -300,17 +250,76 @@ ...@@ -300,17 +250,76 @@
} //methods结束 } //methods结束
}; };
</script> </script>
<style scoped > <style scoped>
/deep/ .el-card__body{
height: 100%;
overflow: hidden;
}
.ruleFormshop { .ruleFormshop {
width: 500px; height: calc(100% - 110px);
margin: 20px 0 0 120px; padding: 20px;
overflow-y: auto;
}
.ruleFormshop .el-form-item {
margin-bottom: 26px;
} }
/deep/ .spe-code-con-item .el-input-group__append { /deep/ .spe-code-con-item .el-input-group__append {
cursor: pointer; cursor: pointer;
} }
/deep/ .el-card__body{
height :calc(100% - 50px); .card-header-title {
overflow-y: scroll; height: 45px;
line-height: 35px;
font-size: 18px;
color: #000;
font-weight: bold;
border-bottom: 1px solid #eee;
}
.blue-block {
display: inline-block;
width: 5px;
height: 24px;
background: #3A84FF;
margin: 0 9px 0 0;
border-radius: 2px;
vertical-align: middle;
}
.footer-btn {
width: calc(100% + 40px);
margin-left: -20px;
padding-top: 20px;
height:65px;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
box-shadow: 0 -8px 9px 1px rgba(51, 51, 51, 0.06);
}
.withdraw-tip-spe {
font-size:12px;
color: #999;
margin: 0;
}
.withdraw-tip {
font-size:12px;
color: #999;
margin: 5px;
line-height: 26px;
}
.spe-span-a {
color: #409EFF;
cursor: pointer;
}
.spe-span-a:hover {
/*color: #46a6ff;*/
} }
</style> </style>
...@@ -2,87 +2,111 @@ ...@@ -2,87 +2,111 @@
<div class="app-container"> <div class="app-container">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<p style="font-size: 18px; float:left;">提现记录</p> <el-form class="form-params" :model="queryParams" label-width="auto" :inline="true" size="small">
<el-form-item label="提现时间" prop="cashTime">
<el-date-picker
v-model="queryParams.cashTime"
type="daterange"
align="left"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="提现状态" prop="pay_status">
<el-select v-model="queryParams.pay_status" placeholder="全部类型" clearable >
<el-option label="全部类型" :value="-1"></el-option>
<el-option label="打款中" :value="0" ></el-option>
<el-option label="提现成功" :value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</div> </div>
<el-table v-loading="loading" :data="withdrawlogList" :height="tableHeight"> <el-table :data="withdrawlogList" :height="tableHeight">
<el-table-column label="提现流水单号" align="center" prop="ReflectSn"/> <el-table-column label="序号" align="center" width="55">
<el-table-column label="提现账号" align="center" prop="BankName">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <span>{{ scope.$index + 1 }}</span>
{{ scope.row.BankAccountNo }}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="提现金额" :formatter="formatFee" align="center" prop="ReflectMoney"/> <el-table-column label="提现流水单号" align="center" prop="sn" width="240"></el-table-column>
<el-table-column label="提现状态" align="center" :formatter="formatType" prop="Status"/> <el-table-column label="提现时间" :formatter="formatTime" align="center" prop="created_time"></el-table-column>
<el-table-column label="提现审核说明" align="center" prop="Des"/> <el-table-column label="提现金额" :formatter="formatFee" align="center" prop="amount"></el-table-column>
<el-table-column label="提现时间" :formatter="formatTime" align="center" prop="AddTime"/> <el-table-column label="手续费" :formatter="formatFee" align="center" prop="service_fee"></el-table-column>
<el-table-column label="手续费" :formatter="formatFee" align="center" prop="Fee"/> <el-table-column label="实际到账金额" :formatter="formatFee" align="center" prop="real_amount"></el-table-column>
<el-table-column label="实际到账金额" :formatter="formatFee" align="center" prop="AfterReflectMoney"/> <el-table-column label="提现状态" align="center" prop="pay_status">
<template slot-scope="scope">
<span v-if="scope.row.pay_status == 0">打款中</span>
<span v-if="scope.row.pay_status == 1">提现成功</span>
</template>
</el-table-column>
<el-table-column label="开票状态" align="center" prop="invoice_status">
<template slot-scope="scope">
<span v-if="scope.row.invoice_status == 0">未开票</span>
<span v-if="scope.row.invoice_status == 1">已开票</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="viewDetails(scope.row)">详情</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="提现账号" align="center" prop="BankName">-->
<!-- <template slot-scope="scope">-->
<!-- <div>-->
<!-- {{ scope.row.BankAccountNo }}-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="提现审核说明" align="center" prop="Des"/>-->
</el-table> </el-table>
<pagination <!-- 分页 -->
v-show="total>0" <div class="footer_pagination">
:total="total" <el-pagination
:page.sync="queryParams.page" background
:limit.sync="queryParams.limit" @size-change="handleSizeChange"
@pagination="getList" @current-change="handleCurrentChange"
/> :current-page="currentPage"
:page-sizes="[20, 40, 60, 80, 100]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import { import { getWithdrawData } from '@/api/module/bankcard'
listWithdrawlog, import { dateFormat } from '@/utils'
getWithdrawlog,
delWithdrawlog,
addWithdrawlog,
updateWithdrawlog
} from '@/api/module/withdrawlog'
import {dateFormat} from '@/utils'
export default { export default {
name: "withdrawlog", name: "withdrawlog",
data() { data() {
return { return {
sellerId: 0,
fullHeight: 0, fullHeight: 0,
tableHeight: 0, tableHeight: 0,
// 遮罩层
loading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 商户提现表格数据
withdrawlogList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数 // 查询参数
queryParams: { queryParams: { // 查询参数
page: 1,
limit: 10,
sellerId: 0, sellerId: 0,
cashTime: [],
pay_status: ''
}, },
// 表单参数 total: 0,
form: {}, currentPage: 1,
// 表单校验 pageSize: 20,
rules: { withdrawlogList: [],
status: [
{required: true, message: "提现状态 0申请提现 1提现成功 2提现失败不能为空", trigger: "blur"}
],
}
}; };
}, },
created() { created() {
this.sellerId = this.$store.state.user.sellerid; /** 查询 提现记录 列表 */
this.getList(); this.getList();
this.$nextTick(() => { this.$nextTick(() => {
this.fullHeight = document.getElementsByClassName('box-card')[0].clientHeight this.fullHeight = document.getElementsByClassName('box-card')[0].clientHeight
...@@ -91,78 +115,115 @@ ...@@ -91,78 +115,115 @@
watch: { watch: {
fullHeight(val) { fullHeight(val) {
let formHeight = document.getElementsByClassName('clearfix')[0].clientHeight let formHeight = document.getElementsByClassName('clearfix')[0].clientHeight
this.tableHeight = val - formHeight - 120; this.tableHeight = val - formHeight - 100;
} }
}, },
methods: { methods: {
//格式化状态 /** 查询 提现记录 列表 */
formatType(row) { getList() {
var types = row.Status let params = {
var optDes = '' page: this.currentPage,
if (types == 1) { limit: this.pageSize,
optDes = "提现成功"
} else if (types == 2) {
optDes = "提现失败"
} else if (types == 0) {
optDes = "提现申请中"
} }
return optDes
if (this.queryParams.pay_status === 0 || this.queryParams.pay_status === 1) {
params['pay_status'] = this.queryParams.pay_status
}
if( this.queryParams.cashTime && this.queryParams.cashTime.length == 2) {
params['start_time'] = new Date(this.queryParams.cashTime[0]).getTime() / 1000;
params['end_time'] = new Date(this.queryParams.cashTime[1]).getTime() / 1000;
}
getWithdrawData(params).then(response => {
if (response) {
this.withdrawlogList = response.data.data;
this.total = response.data.count;
} else {
this.$message({message: '数据出错啦!', type: 'error'});
}
});
},
/** 详情 跳转 */
viewDetails(row) {
const indexId = row.id ? row.id : 0;
this.$router.push({
path: '/system/asset/wddetails',
query: { withdrawId: indexId }
});
},
/** 重置 搜索条件 */
resetQuery() {
this.queryParams = { // 查询参数
sellerId: 0,
cashTime: [],
pay_status: ''
}
this.currentPage = 1
this.pageSize = 20
this.getList();
},
handleSizeChange(val) {
this.pageSize = val
this.getList()
}, },
//格式化价格 handleCurrentChange(val) {
this.currentPage = val
this.getList()
},
/** 格式化价格 返回原数据是 分,除以100 */
formatFee(row, s, value, i) { formatFee(row, s, value, i) {
var nm = 0 let nm = 0,
var money = value money = value
if (money > 0) { if (money > 0) {
nm = money / 100 nm = money / 100
} }
return nm return nm
}, },
//格式化时间 /** 格式化时间 */
formatTime(row) { formatTime(row) {
var Time = row.AddTime var Time = row.created_time
var newtime = "" var newtime = ""
if (Time > 0) { if (Time > 0) {
newtime = dateFormat(Time * 1000, "Y-m-d H:i:s"); newtime = dateFormat(Time * 1000, "Y-m-d H:i:s");
} }
return newtime return newtime
}, },
/** 查询商户提现列表 */
getList() {
this.queryParams.sellerId = this.sellerId;
listWithdrawlog(this.queryParams).then(response => {
if (response) {
this.withdrawlogList = response.data.data;
this.total = response.data.count;
} else {
this.$message({message: '数据出错啦!', type: 'error'});
}
});
},
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false; // this.open = false;
this.reset(); // this.reset();
}, },
// 表单重置 // 表单重置
reset() { reset() {
this.form = { // this.form = {
id: null, // id: null,
reflect_sn: null, // reflect_sn: null,
reflect_money: null, // reflect_money: null,
status: 0, // status: 0,
des: null, // des: null,
seller_bank_id: null, // seller_bank_id: null,
add_time: null, // add_time: null,
fee: null, // fee: null,
seller_id: null, // seller_id: null,
after_reflect_money: null // after_reflect_money: null
}; // };
this.resetForm("form"); // this.resetForm("form");
}, },
} //methods结束 } //methods结束
}; };
</script> </script>
<style scoped lang="scss" type="text/stylus"> <style scoped>
.form-params .el-form-item {
margin: 10px 0 10px 10px;
}
/* 分页 */
.footer_pagination {
text-align: center;
margin-top: 15px;
}
</style> </style>
...@@ -379,9 +379,9 @@ ...@@ -379,9 +379,9 @@
if(res.data) { if(res.data) {
urlObj.url = res.data.image_url; urlObj.url = res.data.image_url;
this.goodsImgFileList.push(urlObj); this.goodsImgFileList.push(urlObj);
this.goodsImgFileList.forEach(item=> { // this.goodsImgFileList.forEach(item=> {
this.goodsInfoForm.imgs.push(item.url) // this.goodsInfoForm.imgs.push(item.url)
}) // })
this.$message({type:'success',message:'图片上传成功'}); this.$message({type:'success',message:'图片上传成功'});
// 只清除一次,不浪费哦 // 只清除一次,不浪费哦
if(this.goodsImgFileList.length === 1) { if(this.goodsImgFileList.length === 1) {
......
...@@ -9,62 +9,11 @@ ...@@ -9,62 +9,11 @@
</el-card> </el-card>
<el-card style="margin-top: 20px;"> <el-card style="margin-top: 20px;">
<div class="orderList"> <div class="orderList">
<div class="orderItem">
<div class="orderTitle">
<img class="icon" src="@/assets/image/order/icon1.png" alt="">
<span>订单信息</span>
</div>
<div>
<el-row class="row-title">
<el-col :span="3" class="text-r">订单编号</el-col>
<el-col :span="6" class="text-l">{{orderDetail ? orderDetail.parent_order_sn : ''}}</el-col>
</el-row>
<el-row class="row-title">
<el-col :span="3" class="text-r">下单时间</el-col>
<el-col :span="6" class="text-l">{{orderDetail ? formatter(orderDetail.created_time) : ''}}</el-col>
</el-row>
<el-row class="row-title">
<el-col :span="3" class="text-r">商品数量</el-col>
<el-col :span="6" class="text-l">{{orderDetail ? orderDetail.goods_total : ''}}</el-col>
</el-row>
<el-row class="row-title">
<el-col :span="3" class="text-r">商品总价</el-col>
<el-col :span="6" class="text-l">{{orderDetail ? orderDetail.goods_price / 100 : ''}}</el-col>
</el-row>
<el-row class="row-title">
<el-col :span="3" class="text-r">运费</el-col>
<el-col :span="6" class="text-l">{{orderDetail ? orderDetail.dispatch_price / 100 : ''}}</el-col>
</el-row>
</div>
</div>
<div class="orderItem">
<div class="orderTitle" style="justify-content: space-between; width: 75%;">
<div style="display: flex; align-items: center;">
<img class="icon" src="@/assets/image/order/icon2.png" alt="">
<span>买家信息</span>
</div>
<el-button size="mini" type="primary" @click="modifyinfo" :disabled="orderDetail && orderDetail.status > 1">修改买家信息</el-button>
</div>
<div>
<el-row class="row-title">
<el-col :span="3" class="text-r">收货人姓名</el-col>
<el-col :span="6" class="text-l">{{ orderDetail ? orderDetail.real_name : ''}}</el-col>
<el-col :span="3" class="text-r">联系电话</el-col>
<el-col :span="6" class="text-l">{{ orderDetail ? orderDetail.mobile : ''}}</el-col>
</el-row>
<el-row class="row-title">
<el-col :span="3" class="text-r">收货地址</el-col>
<el-col :span="6" class="text-l">{{orderDetail ? orderDetail.provice + orderDetail.city + orderDetail.district + orderDetail.street + orderDetail.address : ''}}</el-col>
<el-col :span="3" class="text-r"></el-col>
<el-col :span="6" class="text-l"></el-col>
</el-row>
</div>
</div>
<div class="orderItem"> <div class="orderItem">
<div class="orderTitle" style="justify-content: space-between;"> <div class="orderTitle" style="justify-content: space-between;">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<img class="icon" src="@/assets/image/order/icon3.png" alt=""> <img class="icon" src="@/assets/image/order/icon3.png" alt="">
<span>商品信息</span> <span>订单信息</span>
</div> </div>
<div> <div>
<el-button size="mini" type="primary" @click="goShipping(1)">去发货</el-button> <el-button size="mini" type="primary" @click="goShipping(1)">去发货</el-button>
...@@ -83,8 +32,8 @@ ...@@ -83,8 +32,8 @@
<el-table-column label="规格/数量/单价" align="center"> <el-table-column label="规格/数量/单价" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.goods_option_title }}<br/> {{ scope.row.goods_option_title }}<br/>
{{scope.row.total}}<br/> {{scope.row.goods_price / 100}}<br/>
{{scope.row.goods_price / 100}} x {{scope.row.total }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="商品订单状态" align="center"> <el-table-column label="商品订单状态" align="center">
...@@ -104,19 +53,71 @@ ...@@ -104,19 +53,71 @@
</el-table-column> </el-table-column>
<el-table-column label="发货时间" prop="send_time" align="center"> <el-table-column label="发货时间" prop="send_time" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.send_time ? scope.row.send_time : '—' }} {{ scope.row.send_time ? formatter(scope.row.send_time) : '—' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" align="center"> <el-table-column label="操作" class-name="small-padding fixed-width" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="font-size:12px;padding: 0 15px 0 0;" v-if="deliveryTypeText(scope.row.goods_status,scope.row.is_reissue) == '已补单'">已补单</span> <span style="font-size:12px;padding: 0 15px 0 0;" v-if="deliveryTypeText(scope.row.goods_status,scope.row.is_reissue) == '已补单'">已补单</span>
<el-button size="mini" type="text" v-if="deliveryTypeText(scope.row.goods_status,scope.row.is_reissue) == '去补单'" @click="goShipping(4,scope.row.id)">去补单</el-button> <el-button size="mini" type="text" v-if="deliveryTypeText(scope.row.goods_status,scope.row.is_reissue) == '去补单'" @click="goShipping(4,scope.row.id)">去补单</el-button>
<el-button size="mini" type="text" v-if="deliveryTypeText(scope.row.goods_status,scope.row.is_reissue) == '去发货'" @click="goShipping(3,scope.row.id)">去发货</el-button> <el-button size="mini" type="text" v-if="deliveryTypeText(scope.row.goods_status,scope.row.is_reissue) == '去发货'" @click="goShipping(3,scope.row.id)">去发货</el-button>
<el-divider direction="vertical"></el-divider>
<el-button size="mini" type="text" @click="getExpressInfoNew(scope.row)">查看物流</el-button> <el-button size="mini" type="text" @click="getExpressInfoNew(scope.row)">查看物流</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<!-- <div class="orderItem">-->
<!-- <div class="orderTitle">-->
<!-- <img class="icon" src="@/assets/image/order/icon1.png" alt="">-->
<!-- <span>订单信息</span>-->
<!-- </div>-->
<!-- <div>-->
<!-- <el-row class="row-title">-->
<!-- <el-col :span="3" class="text-r">订单编号</el-col>-->
<!-- <el-col :span="6" class="text-l">{{orderDetail ? orderDetail.parent_order_sn : ''}}</el-col>-->
<!-- </el-row>-->
<!-- <el-row class="row-title">-->
<!-- <el-col :span="3" class="text-r">下单时间</el-col>-->
<!-- <el-col :span="6" class="text-l">{{orderDetail ? formatter(orderDetail.created_time) : ''}}</el-col>-->
<!-- </el-row>-->
<!-- <el-row class="row-title">-->
<!-- <el-col :span="3" class="text-r">商品数量</el-col>-->
<!-- <el-col :span="6" class="text-l">{{orderDetail ? orderDetail.goods_total : ''}}</el-col>-->
<!-- </el-row>-->
<!-- <el-row class="row-title">-->
<!-- <el-col :span="3" class="text-r">商品总价</el-col>-->
<!-- <el-col :span="6" class="text-l">{{orderDetail ? orderDetail.goods_price / 100 : ''}}</el-col>-->
<!-- </el-row>-->
<!-- <el-row class="row-title">-->
<!-- <el-col :span="3" class="text-r">运费</el-col>-->
<!-- <el-col :span="6" class="text-l">{{orderDetail ? orderDetail.dispatch_price / 100 : ''}}</el-col>-->
<!-- </el-row>-->
<!-- </div>-->
<!-- </div>-->
<div class="orderItem">
<div class="orderTitle" style="justify-content: space-between; width: 75%;">
<div style="display: flex; align-items: center;">
<img class="icon" src="@/assets/image/order/icon2.png" alt="">
<span>买家信息</span>
</div>
<el-button size="mini" type="primary" @click="modifyinfo" :disabled="orderDetail.isEditBuyerInfo">修改买家信息</el-button>
</div>
<div>
<el-row class="row-title">
<el-col :span="4" class="text-r">收货人姓名</el-col>
<el-col :span="4" class="text-r">联系电话</el-col>
<el-col :span="10" class="text-r">收货地址</el-col>
</el-row>
<el-row class="row-title">
<el-col :span="4" class="text-l">{{ orderDetail ? orderDetail.real_name : ''}}</el-col>
<el-col :span="4" class="text-l">{{ orderDetail ? orderDetail.mobile : ''}}</el-col>
<el-col :span="10" class="text-l">{{orderDetail ? orderDetail.provice + orderDetail.city + orderDetail.district + orderDetail.street + orderDetail.address : ''}}</el-col>
</el-row>
</div>
</div>
<!-- <div class="orderItem"> <!-- <div class="orderItem">
<div class="orderTitle"> <div class="orderTitle">
<img class="icon" src="@/assets/image/order/icon4.png" alt=""> <img class="icon" src="@/assets/image/order/icon4.png" alt="">
...@@ -204,7 +205,7 @@ ...@@ -204,7 +205,7 @@
<div style="margin: 0 10%"> <div style="margin: 0 10%">
<el-form ref="form" label-width="100px"> <el-form ref="form" label-width="100px">
<el-form-item label="快递公司:"> <el-form-item label="快递公司:">
<el-select size="mini" v-model="expressNum" placeholder="请选择快递公司" style="width: 100%;"> <el-select size="mini" v-model="expressNum" filterable placeholder="请选择快递公司" style="width: 100%;">
<el-option <el-option
v-for="item in expressLists" v-for="item in expressLists"
:key="item.value" :key="item.value"
...@@ -259,7 +260,7 @@ ...@@ -259,7 +260,7 @@
:type="activity.type" :type="activity.type"
color="#0bbd87" color="#0bbd87"
:size="activity.size" :size="activity.size"
:timestamp="formatter(activity.msgTime)"> :timestamp="activity.msg_time">
{{activity.content}} {{activity.content}}
</el-timeline-item> </el-timeline-item>
</el-timeline> </el-timeline>
...@@ -270,7 +271,7 @@ ...@@ -270,7 +271,7 @@
</template> </template>
<script> <script>
import {orderInfo, sendOrder, expressInfoNew, remarkOrder, orderInfoEdit,deliveryOrderOne, deliveryOrderTwo, toReissueOrderData} from '@/api/module/order' import {orderInfo, sendOrder, expressInfoNew, remarkOrder, orderInfoEdit,deliveryOrder, deliveryOrderAgain, toReissueOrderData} from '@/api/module/order'
import {dateFormat} from '@/utils' import {dateFormat} from '@/utils'
import {getAreaList} from '@/api/module/retreat/address' import {getAreaList} from '@/api/module/retreat/address'
export default { export default {
...@@ -480,9 +481,8 @@ export default { ...@@ -480,9 +481,8 @@ export default {
express_sn: this.express_sn, // 快递单号 express_sn: this.express_sn, // 快递单号
//express_code: '' //express_code: ''
} }
//console.log(11111,paramsObj);
deliveryOrderOne(paramsObj).then(res=> { deliveryOrder(paramsObj).then(res=> {
if(res.code == 1) { if(res.code == 1) {
this.$message({type:'success',message:'发货成功'}); this.$message({type:'success',message:'发货成功'});
this.goShippingDialog = false this.goShippingDialog = false
...@@ -504,7 +504,7 @@ export default { ...@@ -504,7 +504,7 @@ export default {
//console.log("批量补单发货",listObj); //console.log("批量补单发货",listObj);
deliveryOrderTwo(listObj).then(res=> { deliveryOrderAgain(listObj).then(res=> {
if(res.code == 1) { if(res.code == 1) {
this.$message({type:'success',message:'补单发货成功'}); this.$message({type:'success',message:'补单发货成功'});
this.goShippingDialog = false this.goShippingDialog = false
...@@ -526,7 +526,7 @@ export default { ...@@ -526,7 +526,7 @@ export default {
paramsObj.order_goods_ids.push(this.goods_ids); paramsObj.order_goods_ids.push(this.goods_ids);
//console.log(11111,paramsObj); //console.log(11111,paramsObj);
deliveryOrderOne(paramsObj).then(res=> { deliveryOrder(paramsObj).then(res=> {
if(res.code == 1) { if(res.code == 1) {
this.$message({type:'success',message:'发货成功'}); this.$message({type:'success',message:'发货成功'});
this.goShippingDialog = false this.goShippingDialog = false
...@@ -551,7 +551,7 @@ export default { ...@@ -551,7 +551,7 @@ export default {
orderObj.express_sn = this.express_sn; orderObj.express_sn = this.express_sn;
singleOrderObj.list.push(orderObj); singleOrderObj.list.push(orderObj);
deliveryOrderTwo(singleOrderObj).then(res=> { deliveryOrderAgain(singleOrderObj).then(res=> {
if(res.code == 1) { if(res.code == 1) {
this.$message({type:'success',message:'补单发货成功'}); this.$message({type:'success',message:'补单发货成功'});
this.goShippingDialog = false this.goShippingDialog = false
...@@ -576,12 +576,37 @@ export default { ...@@ -576,12 +576,37 @@ export default {
}, },
/** 修改 买家信息 */ /** 修改 买家信息 */
modifyinfo() { modifyinfo() {
// console.log(580,this.orderDetail);
this.addressForm = { this.addressForm = {
shipping_name: '', shipping_name: '',
tel: '', tel: '',
address: '', address: '',
street: '' street: '',
areaList: []
}
if(this.orderDetail.real_name) {
this.addressForm.shipping_name = this.orderDetail.real_name;
}
if(this.orderDetail.mobile) {
this.addressForm.tel = this.orderDetail.mobile;
}
// if(this.orderDetail.provice && this.orderDetail.city && this.orderDetail.district) {
// this.addressForm.areaList.push(this.orderDetail.provice) //this.orderDetail.provice + this.orderDetail.city + this.orderDetail.district
// this.addressForm.areaList.push(this.orderDetail.this.city) //this.orderDetail.provice + this.orderDetail.city + this.orderDetail.district
// this.addressForm.areaList.push(this.orderDetail.district) //this.orderDetail.provice + this.orderDetail.city + this.orderDetail.district
// }else {
// this.addressForm.areaList = []
// }
if(this.orderDetail.street) {
this.addressForm.street = this.orderDetail.street;
} }
if(this.orderDetail.address) {
this.addressForm.address = this.orderDetail.address;
}
this.modifyinfoDialog = true this.modifyinfoDialog = true
}, },
/** 保存 买家信息 */ /** 保存 买家信息 */
...@@ -787,7 +812,7 @@ export default { ...@@ -787,7 +812,7 @@ export default {
align-items: center; align-items: center;
} }
/deep/.el-dialog__body { /deep/.el-dialog__body {
padding-bottom: 0; padding: 20px;
} }
/deep/.el-input--medium .el-input__inner { /deep/.el-input--medium .el-input__inner {
height: 28px; height: 28px;
...@@ -799,11 +824,13 @@ export default { ...@@ -799,11 +824,13 @@ export default {
} }
.text-r { .text-r {
justify-content: flex-end; justify-content: center;
background: #F7F8FA; background: #F7F8FA;
align-items: center;
} }
.text-l { .text-l {
text-align: left; justify-content: center;
align-items: center;
} }
.orderItem { .orderItem {
margin-bottom: 20px; margin-bottom: 20px;
...@@ -830,6 +857,7 @@ export default { ...@@ -830,6 +857,7 @@ export default {
.logistics { .logistics {
height: 600px; height: 600px;
overflow-y: auto; overflow-y: auto;
padding: 10px;
} }
/* 留言框样式 */ /* 留言框样式 */
......
...@@ -13,28 +13,31 @@ ...@@ -13,28 +13,31 @@
<el-tab-pane label="已完成" name="third"></el-tab-pane> <el-tab-pane label="已完成" name="third"></el-tab-pane>
<el-tab-pane label="全部订单" name="fourth"></el-tab-pane> <el-tab-pane label="全部订单" name="fourth"></el-tab-pane>
</el-tabs> </el-tabs>
<div v-show="this.activeName == 'first' " style="position: absolute; top: -5px; right: 0;"> <div v-show="activeName == 'first' " style="position: absolute; top: -5px; right: 0;">
<el-button size="mini" type="primary" icon="el-icon-download" @click="handleExport">导出订单</el-button> <el-button size="mini" type="primary" icon="el-icon-download" @click="handleExportUnSendOrder">导出订单</el-button>
<el-button size="mini" icon="el-icon-position" @click="isDeliveryOpen = true">批量发货</el-button> <el-button size="mini" icon="el-icon-position" @click="handleExportDeliveryOrder">批量发货</el-button>
</div>
<div v-show="activeName == 'fourth' " style="position: absolute; top: -5px; right: 0;">
<el-button size="mini" type="primary" icon="el-icon-download" @click="handleAllOrderExport">导出订单</el-button>
</div> </div>
</div> </div>
<div class="form-box"> <div class="form-box">
<el-form class="form-params" ref="form" :model="form" label-width="85px"> <el-form class="form-params" ref="form" :model="form" label-width="85px">
<el-row type="flex" class="row-bg" justify="space-around"> <el-row type="flex" class="row-bg" justify="space-around">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="订单号:"> <el-form-item label="订单号:">
<el-input size="mini" v-model="form.order_sn" placeholder="请输入订单号"/> <el-input size="mini" v-model="form.order_sn" placeholder="请输入订单号"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="商品名称:"> <el-form-item label="商品名称:">
<el-input size="mini" v-model="form.GoodsName" placeholder="请输入商品名称"/> <el-input size="mini" v-model="form.goods_name" placeholder="请输入商品名称"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="收货人:"> <el-form-item label="收货人:">
<el-input size="mini" v-model="form.shipname" placeholder="请输入收货人"/> <el-input size="mini" v-model="form.real_name" placeholder="请输入收货人"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -44,7 +47,7 @@ ...@@ -44,7 +47,7 @@
<el-input size="mini" v-model="form.Tel" placeholder="请输入联系电话"/> <el-input size="mini" v-model="form.Tel" placeholder="请输入联系电话"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6" v-show="activeName == 'first' || activeName == 'fourth' ">
<el-form-item label="下单时间:"> <el-form-item label="下单时间:">
<el-date-picker <el-date-picker
size="mini" size="mini"
...@@ -58,6 +61,34 @@ ...@@ -58,6 +61,34 @@
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" v-show="activeName == 'second' ">
<el-form-item label="发货时间:">
<el-date-picker
size="mini"
v-model="form.sendTime"
type="daterange"
align="left"
unaLink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6" v-show="activeName == 'third' ">
<el-form-item label="完成时间:">
<el-date-picker
size="mini"
v-model="form.finishTime"
type="daterange"
align="left"
unaLink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6"> <el-col :span="6">
<el-button size="mini" type="primary" icon="el-icon-search" style="margin-left: 20px;" <el-button size="mini" type="primary" icon="el-icon-search" style="margin-left: 20px;"
@click="getListOrder">搜索 @click="getListOrder">搜索
...@@ -70,26 +101,25 @@ ...@@ -70,26 +101,25 @@
<!-- 表头 --> <!-- 表头 -->
<div class="table-header-spe"> <div class="table-header-spe">
<el-table class="title_table hxz-el-table" align="center"> <el-table class="title_table hxz-el-table" align="center">
<el-table-column align="center" width="55"> <el-table-column align="center" width="55" v-if="activeName == 'fourth' ">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
<el-checkbox v-model="allTablesChecked" ></el-checkbox> <el-checkbox v-model="allTablesChecked" ></el-checkbox>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="订单号" align="center" width="180" ></el-table-column> <el-table-column label="订单号" align="center" width="220" ></el-table-column>
<el-table-column label="商品名称" align="center" ></el-table-column> <el-table-column label="商品名称" align="center"></el-table-column>
<el-table-column label="规格/数量/金额" align="center" width="180" ></el-table-column> <el-table-column label="规格/数量/金额" align="center" ></el-table-column>
<el-table-column label="下单时间" align="center" width="180" ></el-table-column> <el-table-column label="下单/发货/完成时间" align="center" width="180" ></el-table-column>
<el-table-column label="收货人" align="center" width="180" ></el-table-column> <el-table-column label="收货人" align="center" width="180" ></el-table-column>
<el-table-column label="联系电话" align="center" width="180"></el-table-column> <el-table-column label="联系电话" align="center" width="180"></el-table-column>
<el-table-column label="操作" align="center" width="140" ></el-table-column> <el-table-column label="操作" align="center" width="120"></el-table-column>
</el-table> </el-table>
<div class="hxz-el-table-check"></div>
</div> </div>
<div class="table-all-con box-card"> <div class="table-all-con box-card">
<el-card v-for="(item, index) in tableDataList" :key="index" class="card1 text item"> <el-card v-for="(item, index) in tableDataList" :key="index" class="card1 text item">
<div slot="header" class="el-card-header-spe"> <div slot="header" class="el-card-header-spe">
<div><span>订单状态:</span><span>{{ orderStatusFormatter(item.order.status) }}</span></div> <div><span>订单状态:</span><span>{{ orderStatusFormatter(item.order.status) }}</span><span style="margin: 0 0 0 30px;">总订单号:</span><span>{{ item.order.order_sn }}</span></div>
</div> </div>
<div class="item-table"> <div class="item-table">
<el-table <el-table
...@@ -97,29 +127,41 @@ ...@@ -97,29 +127,41 @@
:show-header="false" :show-header="false"
:span-method="arraySpanMethod" :span-method="arraySpanMethod"
:data="item.order_goods"> :data="item.order_goods">
<el-table-column type="selection" width="55" align="center"></el-table-column> <el-table-column type="selection" width="55" align="center" v-if="activeName == 'fourth' "></el-table-column>
<el-table-column prop="goods_order_sn" label="订单号" width="180" align="center"></el-table-column> <el-table-column prop="goods_order_sn" label="订单号" width="220" align="center"></el-table-column>
<el-table-column prop="goods_option_title" label="商品名称" align="center"> <el-table-column prop="title" label="商品名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<img style="width:60px;height:60px;" :src="scope.row.thumb"/> <div class="img-title-table">
<div>{{ scope.row.goods_option_title }}</div> <img v-if="scope.row.thumb" style="width:60px;height:60px;" :src="scope.row.thumb"/>
<div class="ml10">{{ scope.row.title }}</div>
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="规格/数量/金额" width="180" align="center"> <el-table-column label="规格/数量/金额" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.goods_option_title }}<br/> {{ scope.row.goods_option_title }}<br/>
{{ scope.row.total }}<br/> {{ scope.row.goods_price / 100 }}<br/>
{{ scope.row.goods_price / 100 }}<br/> x {{ scope.row.total }}<br/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="created_time" label="下单时间" width="180" align="center"> <el-table-column prop="created_time" label="下单时间" width="180" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ formatter(scope.row.created_time) }} {{ speTiemFormatter(scope.row.created_time) }}<br/>
{{ speTiemFormatter(scope.row.send_time) }}<br/>
{{ speTiemFormatter(scope.row.updated_time) }}
</template>
</el-table-column>
<el-table-column prop="phone" width="180" label="收货人" align="center">
<template slot-scope="scope">
{{ item.order.real_name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="phone" width="180" label="收货人" align="center"></el-table-column> <el-table-column prop="mobile" label="联系电话" width="180" align="center">
<el-table-column prop="real_name" label="联系电话" width="180" align="center"></el-table-column> <template slot-scope="scope">
<el-table-column label="操作" width="140" align="center"> {{ item.order.mobile }}
</template>
</el-table-column>
<el-table-column label="操作" width="120" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="handleInfo(scope.row)">详情</el-button> <el-button type="text" @click="handleInfo(scope.row)">详情</el-button>
</template> </template>
...@@ -150,7 +192,7 @@ ...@@ -150,7 +192,7 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 批量发货 --> <!-- 批量发货 -->
<el-dialog title="批量发货流程" :visible.sync="isDeliveryOpen" width="60%" center> <el-dialog title="批量发货流程" :visible.sync="isDeliveryOpen" width="60%" center :before-close="cancelExport">
<el-steps :active="3" align-center style="width:95%;margin: 0 auto;"> <el-steps :active="3" align-center style="width:95%;margin: 0 auto;">
<el-step title="导出发货Excel表单" description=""> <el-step title="导出发货Excel表单" description="">
<template slot="icon"> <template slot="icon">
...@@ -193,7 +235,7 @@ ...@@ -193,7 +235,7 @@
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="isDeliveryOpen = false">取 消</el-button> <el-button @click="cancelExport">取 消</el-button>
<el-button type="primary" @click="subDelivery">确 定</el-button> <el-button type="primary" @click="subDelivery">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
...@@ -201,7 +243,7 @@ ...@@ -201,7 +243,7 @@
</template> </template>
<script> <script>
import {listOrder, exportOrder, orderInfo, deliveryOrder, expressList, getOrderTabData} from '@/api/module/order' import {listOrder, exportOrder, orderInfo, deliveryOrder, expressList, getOrderTabData , exportUnSendOrderGoodsData,deliveryOrderExport} from '@/api/module/order'
import {dateFormat} from '@/utils' import {dateFormat} from '@/utils'
import OrderDetail from './components/orderDetail.vue' import OrderDetail from './components/orderDetail.vue'
import XLSX from "xlsx" import XLSX from "xlsx"
...@@ -222,10 +264,12 @@ ...@@ -222,10 +264,12 @@
activeName: 'first', activeName: 'first',
form: { form: {
order_sn: '', order_sn: '',
GoodsName: '', goods_name: '',
shipname: '', real_name: '',
Tel: '', Tel: '',
dateTime: [], dateTime: [],
finishTime: [],
sendTime: [],
}, },
goodsStatus: 1, goodsStatus: 1,
tableDataList: [], // 后台返回所有数据 tableDataList: [], // 后台返回所有数据
...@@ -241,14 +285,7 @@ ...@@ -241,14 +285,7 @@
tableHeight: null, tableHeight: null,
allTablesChecked: false, allTablesChecked: false,
// 订单导出 入参 // 订单导出 入参
exportParams: { exportParams: {}
order_sn: '',
goods_name: '',
real_name: '',
tel: 0,
created_start_time: 0,
created_end_time: 0,
}
} }
}, },
watch: { watch: {
...@@ -267,8 +304,6 @@ ...@@ -267,8 +304,6 @@
mounted() { mounted() {
/** 获取 seller_id*/ /** 获取 seller_id*/
this.sellerId = this.$store.state.user.sellerid; this.sellerId = this.$store.state.user.sellerid;
// 获取 订单 状态对应数量
//this.getOrderTab()
// 订单列表 搜索 // 订单列表 搜索
this.getListOrder() this.getListOrder()
// //
...@@ -280,7 +315,7 @@ ...@@ -280,7 +315,7 @@
}, },
// 表格合并 列单元格 // 表格合并 列单元格
arraySpanMethod({ row, column, rowIndex, columnIndex }) { arraySpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex > 5) { // 用于设置要合并开始的列号 if (columnIndex > 3) { // 用于设置要合并开始的列号
if (rowIndex === 0) { // 用于设置合并开始的行号 if (rowIndex === 0) { // 用于设置合并开始的行号
return { return {
rowspan: 100,     // 合并的行数 rowspan: 100,     // 合并的行数
...@@ -297,6 +332,13 @@ ...@@ -297,6 +332,13 @@
formatter(time) { formatter(time) {
return dateFormat(time *1000, 'Y-m-d H:i:s') return dateFormat(time *1000, 'Y-m-d H:i:s')
}, },
speTiemFormatter(time) {
if (time) {
return dateFormat(time *1000, 'Y-m-d H:i:s')
}else {
return '--'
}
},
/** 订单状态 */ /** 订单状态 */
orderStatusFormatter(status) { orderStatusFormatter(status) {
if(status === -1) { if(status === -1) {
...@@ -319,10 +361,12 @@ ...@@ -319,10 +361,12 @@
resetBtn(iscall) { resetBtn(iscall) {
this.form = { this.form = {
order_sn: '', order_sn: '',
GoodsName: '', goods_name: '',
shipname: '', real_name: '',
Tel: '', Tel: '',
dateTime: [], dateTime: [],
finishTime: [],
sendTime: [],
} }
this.currentPage = 1 this.currentPage = 1
this.pageSize = 20 this.pageSize = 20
...@@ -345,7 +389,7 @@ ...@@ -345,7 +389,7 @@
this.goodsStatus = 3 this.goodsStatus = 3
break break
case 'fourth': case 'fourth':
this.goodsStatus = -2 this.goodsStatus = 0
break break
default: default:
break break
...@@ -360,19 +404,19 @@ ...@@ -360,19 +404,19 @@
}, },
/** 获取 订单 状态对应数量 */ /** 获取 订单 状态对应数量 */
getOrderTab() { getOrderTab() {
// getOrderTabData().then(res => { getOrderTabData().then(res => {
// //console.log("获取订单状态和对应订单数量",res); //console.log("获取订单状态和对应订单数量",res);
// if (res.code === 1 && res.data.length > 0) { if (res.code === 1 && res.data.length > 0) {
// // 1 表示 代发货;2 表示 已发货 // 1 表示 代发货;2 表示 已发货
// for (let i = 0; i < res.data.length; i++) { for (let i = 0; i < res.data.length; i++) {
// if (res.data[i].Status === 1) { if (res.data[i].Status === 1) {
// this.total1 = res.data[i].Count > 999 ? '999+' : res.data[i].Count; this.total1 = res.data[i].Count > 999 ? '999+' : res.data[i].Count;
// } else if (res.data[i].Status === 2) { } else if (res.data[i].Status === 2) {
// this.total2 = res.data[i].Count > 999 ? '999+' : res.data[i].Count; this.total2 = res.data[i].Count > 999 ? '999+' : res.data[i].Count;
// } }
// } }
// } }
// }); });
}, },
// 获取订单列表 // 获取订单列表
getListOrder() { getListOrder() {
...@@ -382,39 +426,49 @@ ...@@ -382,39 +426,49 @@
limit: this.pageSize, limit: this.pageSize,
seller_id: this.sellerId, seller_id: this.sellerId,
status: this.goodsStatus, status: this.goodsStatus,
start_time: new Date(this.form.dateTime[0]).getTime() / 1000 || '',
end_time: new Date(this.form.dateTime[1]).getTime() / 1000 || '',
order_sn: this.form.order_sn,
goods_name: this.form.GoodsName,
real_name: this.form.shipname,
mobile: this.form.Tel,
} }
if(this.form.order_sn != '') {
params['order_sn'] = this.form.order_sn
}
if(this.form.goods_name != '') {
params['goods_name'] = this.form.goods_name
}
if(this.form.real_name != '') {
params['real_name'] = this.form.real_name
}
if(this.form.Tel != '') {
params['mobile'] = this.form.Tel
}
if( this.form.dateTime && this.form.dateTime.length == 2) {
params['created_start_time'] = new Date(this.form.dateTime[0]).getTime() / 1000;
params['created_end_time'] = new Date(this.form.dateTime[1]).getTime() / 1000;
}
if(this.form.finishTime && this.form.finishTime.length == 2) {
params['finish_start_time'] = new Date(this.form.finishTime[0]).getTime() / 1000;
params['finish_end_time'] = new Date(this.form.finishTime[1]).getTime() / 1000;
}
if(this.form.sendTime && this.form.sendTime.length == 2) {
params['send_start_time'] = new Date(this.form.sendTime[0]).getTime() / 1000;
params['send_end_time'] = new Date(this.form.sendTime[1]).getTime() / 1000;
}
listOrder(params).then(res => { listOrder(params).then(res => {
if (res.code == 1) { if (res.code == 1) {
// 获取 订单 状态对应数量
this.getOrderTab()
// 每次订单 查询成功,保存查询参数,供商品导出接口使用(入参) // 每次订单 查询成功,保存查询参数,供商品导出接口使用(入参)
this.exportParams.order_sn = params.order_sn; this.exportParams = params;
this.exportParams.goods_name = params.goods_name; //console.log("初始赋值:",this.exportParams);
this.exportParams.real_name = params.real_name;
this.exportParams.tel = params.tel;
this.exportParams.created_start_time = params.created_start_time;
this.exportParams.created_end_time = params.created_end_time;
this.total = res.data.count || 0 this.total = res.data.count || 0
this.tableDataList = res.data.data this.tableDataList = res.data.data
if(this.goodsStatus == 1) {
this.taotal1 = res.data.count;
}else if(this.goodsStatus == 2) {
this.taotal2 = res.data.count;
}
} }
}) })
}, },
// 合并数据
// listSpanMethod() {
//
// },
// row 当前行 column 当前列 rowIndex 当前行号, columnIndex 当前列号 // row 当前行 column 当前列 rowIndex 当前行号, columnIndex 当前列号
listSpanMethod({row, column, rowIndex, columnIndex}) { listSpanMethod({row, column, rowIndex, columnIndex}) {
if (columnIndex === 1) { if (columnIndex === 1) {
...@@ -431,9 +485,44 @@ ...@@ -431,9 +485,44 @@
} }
} }
}, },
// 订单导出 /**
handleExport() { * [待发货] 页签 导出订单 操作
exportOrder(this.exportParams).then(res => { * 导出逻辑,根据 当前 搜索条件,导出所有订单
* */
handleExportUnSendOrder() {
let params = this.exportParams;
delete params.page;
delete params.limit;
delete params.seller_id;
delete params.status;
//console.log("导出待发货订单,入参:",params);
exportUnSendOrderGoodsData(params).then(res=> {
if (res.code === 1) {
const aLink = document.createElement('a');
aLink.href = res.data.file_url;
//aLink.download = '订单.xls'; //下载的文件名
aLink.style.display = 'none';
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink);
}else {
this.$message({type:'error',message: res.message ? res.message: '导出失败'});
}
});
},
/**
* [全部订单] 页签 订单导出
* 导出逻辑,根据 当前 搜索条件,导出所有订单
* */
handleAllOrderExport() {
let params = this.exportParams;
delete params.page;
delete params.limit;
delete params.seller_id;
//console.log("导出全部订单,入参:",params);
exportOrder(params).then(res => {
if (res.code === 1) { if (res.code === 1) {
const aLink = document.createElement('a'); const aLink = document.createElement('a');
aLink.href = res.data.file_url; aLink.href = res.data.file_url;
...@@ -496,59 +585,85 @@ ...@@ -496,59 +585,85 @@
removeDevExcel(file, fileList) { removeDevExcel(file, fileList) {
this.excelList = []; this.excelList = [];
}, },
/** 批量发货 - 导入表格 */
handleExportDeliveryOrder() {
this.isDeliveryOpen = true;
this.excelList = [];
},
/** 取消 批量上传发货 */
cancelExport() {
this.$refs.upload.clearFiles();
this.isDeliveryOpen = false;
this.excelList = [];
//console.log(88,this.excelList);
},
// 提交导入数据 // 提交导入数据
subDelivery() { subDelivery() {
if (this.excelList.length === 0) { if (this.excelList.length === 0) {
this.$message({type: 'warning', message: '请先上传填写好的表格数据'}); this.$message({type: 'warning', message: '请先上传填写好的表格数据'});
return return
} }
if (this.excelList.length > 0 && this.excelList[0].id && this.excelList[0].express_name && this.excelList[0].express_sn) { if (this.excelList.length > 0 && this.excelList[0].id && this.excelList[0].express_name && this.excelList[0].express_sn) {
deliveryOrder(this.excelList).then(res => { deliveryOrderExport(this.excelList).then(res => {
if (res.code === 1) { if (res.code === 1) {
this.isDeliveryOpen = false; this.isDeliveryOpen = false;
this.$message({type: 'success', message: '批量发货成功'}); this.$message({type: 'success', message: '批量发货成功'});
this.getList(); this.getListOrder();
} else { } else {
let msg = res.message || '批量发货失败' let msg = res.message || '批量发货失败'
this.$message({type: 'error', message: msg}); this.$message({type: 'error', message: msg});
} }
}); });
} else { } else {
this.$message({type: 'error', message: '导入表格数据有误'}); this.$message({type: 'error', message: '部分订单未填写物流公司或物流单号,请完善后再上传'});
} }
}, },
// 订单详情 // 订单详情
handleInfo(row) { handleInfo(row) {
this.detailDialog = true
let order_id = row.order_id let order_id = row.order_id
orderInfo({order_id: order_id}).then(res => { orderInfo({order_id: order_id}).then(res => {
if (res.code == 1 && res.data) { if (res.code == 1 && res.data) {
this.detailDialog = true
// 留言备注,需要单独处理 // 留言备注,需要单独处理
let remarkList = [] let remarkList = []
// res.data.order.remark 返回数据格式比较多,不判断了 // res.data.order.remark 返回数据格式比较多,不判断了
try { try {
remarkList = JSON.parse(res.data.order.remark) remarkList = JSON.parse(res.data.order.seller_remark)
} catch (e) { } catch (e) {
remarkList = [] remarkList = []
console.log(99,e);
} }
res.data.order.remark = remarkList res.data.order.remark = remarkList
this.order_detail = res.data.order; this.order_detail = res.data.order;
// let isArray = Array.isArray(remarkList) // 商品订单数据 array
//
// if(isArray) {
// res.data.order.remark = remarkList
// this.order_detail = res.data.order;
// }else {
//
// }
this.order_goods_detail = res.data.order_goods_detail ? res.data.order_goods_detail : []; this.order_goods_detail = res.data.order_goods_detail ? res.data.order_goods_detail : [];
// 能否修改买家信息 字段动态添加
// 1,商品订单,只要要发货的,就不能再修改,2,修改过一次的,不能再修改
let isEditBuyerInfo = false;
if(this.order_detail.is_update_address == 1) {
isEditBuyerInfo = true
}else {
if(this.order_goods_detail.length > 0) {
for(let i = 0; i < this.order_goods_detail.length; i++) {
if(this.order_goods_detail[i].goods_status > 0) {
isEditBuyerInfo = true
break;
}
}
}
}
this.order_detail['isEditBuyerInfo'] = isEditBuyerInfo;
//console.log('备注留言返回原始数据',res.data.order.remark); //console.log('备注留言返回原始数据',res.data.order.remark);
// this.$router.push({path: '/system/goods/management'}); // this.$router.push({path: '/system/goods/management'});
} else if(res.code == 0) {
let msg = res.message ? res.message : '暂无数据'
this.$message({type: 'error',message: msg});
} }
}) })
}, },
...@@ -572,7 +687,14 @@ ...@@ -572,7 +687,14 @@
handleCurrentChange(val) { handleCurrentChange(val) {
this.currentPage = val this.currentPage = val
this.getListOrder() this.getListOrder()
} },
/** 时间格式处理 */
// dateTimeChange(val) {
// if( !Array.isArray(val) ) {
// this.form.dateTime = [];
// }
//
// },
} }
}; };
</script> </script>
...@@ -600,15 +722,26 @@ ...@@ -600,15 +722,26 @@
.form-params { .form-params {
} }
.img-title-table {
display: flex;
justify-content: center;
align-items: center;
}
.footer_pagination { .footer_pagination {
text-align: center; text-align: center;
margin-top: 15px; margin-top: 15px;
} }
.delivery-tips-con, .delivery-data-con { .delivery-data-con {
width: 80%;
margin: 10px auto;
font-weight: bold;
}
.delivery-tips-con {
width: 80%; width: 80%;
margin: 5px auto; margin: 60px auto 0;
font-weight: bold; font-weight: bold;
} }
...@@ -648,7 +781,10 @@ ...@@ -648,7 +781,10 @@
.table-all-con { .table-all-con {
height: calc(100% - 250px); height: calc(100% - 250px);
overflow-y: auto; overflow: auto;
padding: 0 20px; }
.ml10 {
margin-left: 10px;
} }
</style> </style>
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
/> />
</el-card> </el-card>
<!-- 新增、修改 --> <!-- 新增、修改 -->
<el-dialog :title="addTitle" :visible.sync="isOpen" width="50%" class="add-edit"> <el-dialog :title="addTitle" :visible.sync="isOpen" width="40%" class="add-edit" center :before-close="cancel">
<el-form v-if="isOpen" :model="addressForm" :rules="addressRules" ref="addressForm" label-width="100px"> <el-form v-if="isOpen" :model="addressForm" :rules="addressRules" ref="addressForm" label-width="100px" size="small">
<el-row> <el-row>
<el-col :span="16" :offset="3"> <el-col :span="16" :offset="3">
<el-form-item label="联系人:" prop="contact_person"> <el-form-item label="联系人:" prop="contact_person">
...@@ -80,8 +80,8 @@ ...@@ -80,8 +80,8 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer" > <div slot="footer" class="dialog-footer" >
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel" size="small">取 消</el-button>
<el-button type="primary" @click="save('addressForm')">确 定</el-button> <el-button type="primary" @click="save('addressForm')" size="small">确 定</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
}, },
// 售后地址列表 // 售后地址列表
addressList:[], addressList:[],
addTitle: '新增/修改', // 新增,修改 弹窗名 addTitle: '', // 新增,修改 弹窗名
// 新增、修改表单 // 新增、修改表单
addressForm: { addressForm: {
id: 0, id: 0,
...@@ -239,10 +239,9 @@ ...@@ -239,10 +239,9 @@
handleAdd() { handleAdd() {
this.isOpen = true; this.isOpen = true;
this.addTitle = "新增地址"; this.addTitle = "新增地址";
this.areaList = [];
this.resetForm('addressForm');
}, },
/** 删除 */
handleDelete(row) { handleDelete(row) {
const roleIds = row.id || this.ids; const roleIds = row.id || this.ids;
this.$confirm('是否确认删除编号为"' + roleIds + '"的数据项?', '确认信息', { this.$confirm('是否确认删除编号为"' + roleIds + '"的数据项?', '确认信息', {
...@@ -257,13 +256,13 @@ ...@@ -257,13 +256,13 @@
}).catch(action => {}); }).catch(action => {});
}, },
// 修改 /** 修改 */
handleUpdate(row) { handleUpdate(row) {
this.areaList = [];
const roleIds = row.id || this.ids; const roleIds = row.id || this.ids;
this.loading = true; this.loading = true;
getAddressDetails(roleIds).then(res => { getAddressDetails(roleIds).then(res => {
if(res.data) { if(res.data) {
this.addTitle = "编辑地址";
this.isOpen = true; this.isOpen = true;
// 处理 三级联动回显 // 处理 三级联动回显
let areaListAry = res.data.address_ids ? res.data.address_ids.split(",") : []; let areaListAry = res.data.address_ids ? res.data.address_ids.split(",") : [];
...@@ -275,11 +274,14 @@ ...@@ -275,11 +274,14 @@
this.loading = false; this.loading = false;
}); });
}, },
/** 取消 新增售后地址 */
cancel() { cancel() {
this.areaList = []; //
this.resetForm('addressForm'); this.resetAddressForm();
this.isOpen = false; this.isOpen = false;
}, },
/** 保存 */
save(form) { save(form) {
if(typeof this.addressForm.address_ids === "string") { if(typeof this.addressForm.address_ids === "string") {
let areaListAry = this.addressForm.address_ids.split(","); let areaListAry = this.addressForm.address_ids.split(",");
...@@ -299,7 +301,8 @@ ...@@ -299,7 +301,8 @@
}else { }else {
this.$message({ message: '修改成功', type: 'success'}); this.$message({ message: '修改成功', type: 'success'});
} }
this.resetAddressForm();
this.isOpen = false;
this.getList(); this.getList();
}else if( res.code === 0){ }else if( res.code === 0){
if(res.msg) { if(res.msg) {
...@@ -308,12 +311,21 @@ ...@@ -308,12 +311,21 @@
this.$message({ message: '新增失败', type: 'error'}); this.$message({ message: '新增失败', type: 'error'});
} }
} }
this.resetForm('addressForm');
this.isOpen = false;
}); });
} }
}); });
}, },
/** 初始化 添加 地址 表单 数据 */
resetAddressForm() {
this.addressForm = {
id: 0,
contact_person: '',
contact_phone: '',
address_ids: [],
address: ''
}
this.areaList = [];
},
// //
handleChanges(value) { handleChanges(value) {
//this.areaList = value; //this.areaList = value;
......
<template> <template>
<div class="app-container after-sale-detail"> <div class="app-container after-sale-detail">
<el-card> <el-card>
<!-- <p class="as-detail-title">售后详情</p>-->
<!-- 仅退款 --> <!-- 仅退款 -->
<div v-if="asOrderType == 1" class="as-step-info"> <div v-if="asOrderType == 1" class="as-step-info">
<el-steps :active="step" align-center> <el-steps :active="step" align-center>
...@@ -24,11 +23,12 @@ ...@@ -24,11 +23,12 @@
<el-card class="as-order-details"> <el-card class="as-order-details">
<!-- 倒计时 提示 --> <!-- 倒计时 提示 -->
<p class="count-down-con" v-if="asOrderType == 1">剩余处理时间: 25小时46分 请在72小时内处理,逾期不处理,系统将自动退款到买家账户</p> <p class="count-down-con" v-if="!(asOrderDetail.status == 5 || asOrderDetail.status == -1)"><i class="spec-icon-w el-icon-warning"></i>剩余处理时间: <span class="cd-time-span">{{ cdHour }} 小时 {{ cdMinute }}</span> 请在期限内处理,逾期不处理,系统将自动退款到买家账户</p>
<p class="count-down-con" v-if="asOrderType == 2">222剩余处理时间: 25小时46分 请在72小时内处理,逾期不处理,系统将自动退款到买家账户222</p>
<!-- 售后信息 --> <!-- 售后信息 -->
<div> <div>
<p>售后信息</p> <div class="card-header-title">
<span class="blue-block blue-block-goods-title"></span>售后信息
</div>
<div> <div>
<el-row class="row-title"> <el-row class="row-title">
<el-col :span="3" class="text-r">售后类型</el-col> <el-col :span="3" class="text-r">售后类型</el-col>
...@@ -49,23 +49,24 @@ ...@@ -49,23 +49,24 @@
<el-row class="row-title-pic"> <el-row class="row-title-pic">
<el-col :span="3" class="text-r">申请图片</el-col> <el-col :span="3" class="text-r">申请图片</el-col>
<el-col :span="9" class="text-l"> <el-col :span="9" class="text-l">
<!-- {{ asOrderDetail.images }}-->
<div v-if="asSrcList.length > 0"> <div v-if="asSrcList.length > 0">
<el-image <el-image
style="width: 70px; height: 70px;border:1px solid #eee;" style="width: 70px; height: 70px;border:1px solid #eee;margin-right:10px;"
v-for="(itemSrc,index) in asSrcList" v-for="(itemSrc,index) in asSrcList"
:src="itemSrc" :src="itemSrc"
:preview-src-list="asSrcList"> :preview-src-list="asSrcList">
</el-image> </el-image>
</div> </div>
<p v-else style="color:#666">暂无图片</p> <p v-else style="color:#999">暂无图片</p>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</div> </div>
<!-- 订单信息 --> <!-- 订单信息 -->
<div> <div>
<p>订单信息</p> <div class="card-header-title">
<span class="blue-block blue-block-goods-title"></span>订单信息
</div>
<div> <div>
<el-row class="row-title"> <el-row class="row-title">
<el-col :span="3" class="text-r">订单状态</el-col> <el-col :span="3" class="text-r">订单状态</el-col>
...@@ -81,7 +82,7 @@ ...@@ -81,7 +82,7 @@
</el-row> </el-row>
<el-row class="row-title"> <el-row class="row-title">
<el-col :span="3" class="text-r">商品金额</el-col> <el-col :span="3" class="text-r">商品金额</el-col>
<el-col :span="6" class="text-l">{{ goodsOrderDetail.price }}</el-col> <el-col :span="6" class="text-l">{{ goodsOrderDetail.goods_price }}</el-col>
<el-col :span="3" class="text-r">商品数量</el-col> <el-col :span="3" class="text-r">商品数量</el-col>
<el-col :span="6" class="text-l">{{ goodsOrderDetail.total }}</el-col> <el-col :span="6" class="text-l">{{ goodsOrderDetail.total }}</el-col>
</el-row> </el-row>
...@@ -89,11 +90,13 @@ ...@@ -89,11 +90,13 @@
</div> </div>
<!-- 历史售后申请 --> <!-- 历史售后申请 -->
<div> <div>
<p>历史售后申请</p> <div class="card-header-title">
<span class="blue-block blue-block-goods-title"></span>历史售后申请
</div>
<el-table :data="asApplyList"> <el-table :data="asApplyList">
<el-table-column label="申请时间" align="center" prop="tabapply_time"> <el-table-column label="申请时间" align="center" prop="created_time">
<template slot-scope="scope"> <template slot-scope="scope">
{{formatter(scope.row.tabapply_time)}} {{formatter(scope.row.created_time)}}
</template> </template>
</el-table-column> </el-table-column>
...@@ -121,7 +124,15 @@ ...@@ -121,7 +124,15 @@
</el-table-column> </el-table-column>
<el-table-column label="申请图片" align="center"> <el-table-column label="申请图片" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.apply_price/100 }} <div v-if="(scope.row.imgs_arr && scope.row.imgs_arr.length > 0)">
<el-image
style="width: 70px; height: 70px;border:1px solid #eee;margin-right:10px;"
v-for="(itemSrc,index) in scope.row.imgs_arr"
:src="itemSrc"
:preview-src-list="scope.row.imgs_arr">
</el-image>
</div>
<p v-else style="color:#666">暂无图片</p>
</template> </template>
</el-table-column> </el-table-column>
...@@ -130,20 +141,20 @@ ...@@ -130,20 +141,20 @@
<!-- 售后 操作按钮 --> <!-- 售后 操作按钮 -->
<div class="as-handle-btn" v-if="onlyOrRefundBtnType == 1"> <div class="as-handle-btn" v-if="onlyOrRefundBtnType == 1">
<el-button class="as-btn" type="primary" @click="agreeHandle(1)">同意退款</el-button> <el-button class="as-btn" type="primary" @click="agreeHandle(1)" :disabled="isFinishedButtonDisabled">同意退款</el-button>
<el-button class="as-btn" type="primary" @click="refuseHandle(2)">拒绝退款</el-button> <el-button class="as-btn" type="primary" @click="refuseHandle(2)" :disabled="isFinishedButtonDisabled">拒绝退款</el-button>
</div> </div>
<div class="as-handle-btn" v-if="onlyOrRefundBtnType == 2"> <div class="as-handle-btn" v-if="onlyOrRefundBtnType == 2">
<el-button class="as-btn" type="primary" @click="agreeHandle(3)">同意退货退款</el-button> <el-button class="as-btn" type="primary" @click="agreeHandle(3)" :disabled="isFinishedButtonDisabled">同意退货退款</el-button>
<el-button class="as-btn" type="primary" @click="refuseHandle(4)">拒绝退货退款</el-button> <el-button class="as-btn" type="primary" @click="refuseHandle(4)" :disabled="isFinishedButtonDisabled">拒绝退货退款</el-button>
</div> </div>
<div class="as-handle-btn" v-if="onlyOrRefundBtnType == 3"> <div class="as-handle-btn" v-if="onlyOrRefundBtnType == 3">
<el-button class="as-btn" type="primary" @click="refuseHandle(4)">拒收包裹</el-button> <el-button class="as-btn" type="primary" @click="refuseHandle(4)" :disabled="isFinishedButtonDisabled">拒收包裹</el-button>
<el-button class="as-btn" type="primary" @click="agreeHandle(1)">确定退款</el-button> <el-button class="as-btn" type="primary" @click="agreeHandle(1)" :disabled="isFinishedButtonDisabled">确定退款</el-button>
</div> </div>
</el-card> </el-card>
<!-- [仅退款 同意/拒绝] [退货退款 确定退款/拒收包裹] 对话框 --> <!-- 售后所有操作 对话框 -->
<el-dialog <el-dialog
:title="dialogASTypeTitle" :title="dialogASTypeTitle"
:visible.sync="isASTypeDialog" :visible.sync="isASTypeDialog"
...@@ -207,6 +218,7 @@ ...@@ -207,6 +218,7 @@
return { return {
// Refund only 仅退款 // Refund only 仅退款
// Return refund 退货退款 // Return refund 退货退款
timer: null,
asGoodId: 0, // 当前 售后订单的 id asGoodId: 0, // 当前 售后订单的 id
asOrderType: 1, // 售后类型 1-仅退款; 2-退货退款 asOrderType: 1, // 售后类型 1-仅退款; 2-退货退款
// 仅退款 流程,每个步骤文字提示 // 仅退款 流程,每个步骤文字提示
...@@ -219,6 +231,8 @@ ...@@ -219,6 +231,8 @@
refundStep3: '售后完成', refundStep3: '售后完成',
refundStep4: '', refundStep4: '',
refundStep5: '', refundStep5: '',
cdHour: 0,
cdMinute: 0,
// 售后订单 信息 // 售后订单 信息
asOrderDetail: { asOrderDetail: {
status: 0, // 退款状态 status: 0, // 退款状态
...@@ -232,16 +246,14 @@ ...@@ -232,16 +246,14 @@
goodsOrderDetail: { goodsOrderDetail: {
goods_status: 0, // 订单状态 goods_status: 0, // 订单状态
goods_order_sn: '', // 订单编号 goods_order_sn: '', // 订单编号
price: '', // 商品金额 goods_price: '', // 商品金额/售后金额
title: '',// 商品名称 title: '',// 商品名称
goods_option_title: '', // 商品规格 goods_option_title: '', // 商品规格
total: '', // 商品数量 total: '', // 商品数量
}, },
// 售后申请 图片 list // 售后申请 图片 list
asSrcList: [], asSrcList: [],
asApplyList: [ asApplyList: [],
{ data1:1256332213,data2: 1,data3: 3,data4: 4,data5:5, data6: 6,data7: 7 }
],
// 0-全部隐藏-默认状态; 1-显示 仅退款 按钮;2-显示 退货退款中(同意/拒绝 退货退款)按钮; 3-显示 退货退款中 (拒收包裹 / 确定退款) 按钮 // 0-全部隐藏-默认状态; 1-显示 仅退款 按钮;2-显示 退货退款中(同意/拒绝 退货退款)按钮; 3-显示 退货退款中 (拒收包裹 / 确定退款) 按钮
onlyOrRefundBtnType: 0, onlyOrRefundBtnType: 0,
// 1-仅退款 同意退款; 2-仅退款 拒绝退款; 3-退货退款 同意退款退款; 4-; 5- // 1-仅退款 同意退款; 2-仅退款 拒绝退款; 3-退货退款 同意退款退款; 4-; 5-
...@@ -252,10 +264,18 @@ ...@@ -252,10 +264,18 @@
refuseReason: '', refuseReason: '',
sellerId: 0, sellerId: 0,
asAddressOptions: [], asAddressOptions: [],
order_refund_address:'' order_refund_address:'',
isFinishedButtonDisabled: false
} // return end } // return end
}, },
watch: {}, watch: {
$route(to,from) {
if(this.$route.query.refund_sn) {
this.asGoodId = this.$route.query.refund_sn;
this.getDetail();
}
}
},
created() { created() {
this.sellerId = this.$store.state.user.sellerid; this.sellerId = this.$store.state.user.sellerid;
/** 获取 当前售后 订单的id */ /** 获取 当前售后 订单的id */
...@@ -265,7 +285,9 @@ ...@@ -265,7 +285,9 @@
/** 获取 退货退款的发送 地址 */ /** 获取 退货退款的发送 地址 */
this.getASAdress(); this.getASAdress();
}, },
mounted() {}, mounted() {
},
methods: { methods: {
/** Only 代表 仅退款 /** Only 代表 仅退款
* 售后步骤和对应文案提示, * 售后步骤和对应文案提示,
...@@ -355,7 +377,7 @@ ...@@ -355,7 +377,7 @@
this.refundStep3 = '买家超时未退货' this.refundStep3 = '买家超时未退货'
this.refundStep4 = '买家未退货,售后关闭' this.refundStep4 = '买家未退货,售后关闭'
this.refundStep5 = '' this.refundStep5 = ''
this.step = 5 this.step = 4
}else if (close_status === 6) { }else if (close_status === 6) {
this.has45 = 3 this.has45 = 3
this.refundStep2 = '买家取消售后申请' this.refundStep2 = '买家取消售后申请'
...@@ -369,20 +391,41 @@ ...@@ -369,20 +391,41 @@
}, },
/** 查询订单详情*/ /** 查询订单详情*/
getDetail() { getDetail() {
//console.log("售后单号",this.asGoodId);
getASOrderDetail({order_refund_sn: this.asGoodId}).then(res=> { getASOrderDetail({order_refund_sn: this.asGoodId}).then(res=> {
//console.log("296",res);
if( res.code === 1 && res.data ) { if( res.code === 1 && res.data ) {
// 售后订单详情 // 售后订单详情
if( res.data.order_refund ) { if( res.data.order_refund ) {
this.asOrderDetail = res.data.order_refund; this.asOrderDetail = res.data.order_refund;
//------------ 测试数据
// this.asOrderDetail.refund_type = 2;
// this.asOrderDetail.status = 2;
// this.asOrderDetail.close_reason = 2;
//--------------
// 先确定 售后类型 // 先确定 售后类型
this.asOrderType = this.asOrderDetail.refund_type this.asOrderType = this.asOrderDetail.refund_type
this.cdHour = this.asOrderDetail.dead_line_hour
this.cdMinute = this.asOrderDetail.dead_line_minute
if (this.cdHour < 0) {
this.cdHour = 0;
}
if (this.cdMinute < 0) {
this.cdMinute = 0;
}
this.timer = setInterval(() => {
if (this.cdHour <= 0) {
this.cdHour = 0
}
if (this.cdMinute <= 0) {
this.cdMinute = 0
}
if (this.cdMinute && this.cdHour) {
this.cdMinute--
if (this.cdMinute <= 0) {
this.cdMinute = 59
this.cdHour--
}
}
}, 60000)
// 根据售后订单信息,判断 订单状态,显示对应按钮操作 // 根据售后订单信息,判断 订单状态,显示对应按钮操作
this.asHandleBtnType(this.asOrderDetail) this.asHandleBtnType(this.asOrderDetail)
// 金额处理 // 金额处理
...@@ -390,27 +433,33 @@ ...@@ -390,27 +433,33 @@
this.asOrderDetail.price = this.asOrderDetail.price / 100 this.asOrderDetail.price = this.asOrderDetail.price / 100
// 售后图片 处理 // 售后图片 处理
this.asSrcList = [] this.asSrcList = []
if(this.asOrderDetail.images) { if(this.asOrderDetail.imgs_arr && this.asOrderDetail.imgs_arr.length > 0) {
this.asSrcList = this.asOrderDetail.images.split(',') this.asSrcList = this.asOrderDetail.imgs_arr
} }
// 更新 售后订单 流程和状态 // 更新 售后订单 流程和状态
// 仅退款 // 仅退款
if(this.asOrderDetail.refund_type == 1) { if(this.asOrderDetail.refund_type == 1) {
this.returnOnlyStatus(this.asOrderDetail.status,this.asOrderDetail.close_reason); this.returnOnlyStatus(this.asOrderDetail.status,this.asOrderDetail.close_reason);
this.$forceUpdate()
} }
// 退货退款 // 退货退款
if(this.asOrderDetail.refund_type == 2) { if(this.asOrderDetail.refund_type == 2) {
this.returnRefundStatus(this.asOrderDetail.status,this.asOrderDetail.close_reason); this.returnRefundStatus(this.asOrderDetail.status,this.asOrderDetail.close_reason);
this.$forceUpdate()
} }
} }
// 订单 详情 // 订单 详情
if(res.data.order_goods) { if(res.data.order_goods) {
this.goodsOrderDetail = res.data.order_goods; this.goodsOrderDetail = res.data.order_goods;
// 商品金额 单位
this.goodsOrderDetail.goods_price = res.data.order_goods.goods_price / 100
} }
// 售后历史 // 售后历史
if(res.data.order_refund_history) { if(res.data.order_refund_history) {
this.asApplyList = res.data.order_refund_history this.asApplyList = res.data.order_refund_history
}else {
this.asApplyList = [];
} }
} }
}); });
...@@ -418,7 +467,7 @@ ...@@ -418,7 +467,7 @@
/** 仅退款 /** 仅退款
* 操作按钮 类型 * 操作按钮 类型
* onlyOrRefundBtnType:// 1-显示 仅退款 按钮; 2-显示 退货退款中(同意/拒绝 退货退款)按钮; 3-显示 退货退款中 (拒收包裹 / 确定退款) 按钮 * onlyOrRefundBtnType:// 1-显示 仅退款 按钮; 2-显示 退货退款中(同意/拒绝 退货退款)按钮; 3-显示 退货退款中 (拒收包裹 / 确定退款) 按钮
* disabledOnlyBtn: true-售后结束-不能点击;false-可以点击 * isFinishedButtonDisabled: true-售后结束-不能点击;false-可以点击
* 每次 订单详情更新,被调用 * 每次 订单详情更新,被调用
* */ * */
asHandleBtnType(row) { asHandleBtnType(row) {
...@@ -433,6 +482,12 @@ ...@@ -433,6 +482,12 @@
}else { }else {
this.onlyOrRefundBtnType = 0; this.onlyOrRefundBtnType = 0;
} }
//
if(row.status == 5 || row.status == -1) {
this.isFinishedButtonDisabled = true
}else {
this.isFinishedButtonDisabled = false
}
} }
}, },
/** 同意 */ /** 同意 */
...@@ -468,15 +523,13 @@ ...@@ -468,15 +523,13 @@
* *
* */ * */
submitAfterSale(type) { submitAfterSale(type) {
console.log("确定的类型",type);
let params = { let params = {
order_refund_sn: 0 order_refund_sn: this.asGoodId
}; };
// type为1,则为,仅退款的 同意退款 操作 // type为1,则为,仅退款的 同意退款 操作
if(this.onlyIsAgree == 1) { if(this.onlyIsAgree == 1) {
params.order_refund_sn = this.asGoodId
// 1、为了更好提示,2、预防后期接口解耦 // 1、为了更好提示,2、预防后期接口解耦
agreeRefundData(params).then(res=> { agreeRefundData(params).then(res=> {
let msg = '' let msg = ''
...@@ -516,7 +569,6 @@ ...@@ -516,7 +569,6 @@
// type 为3,则为,退货退款的 同意退货退款,发送地址 // type 为3,则为,退货退款的 同意退货退款,发送地址
if(this.onlyIsAgree == 3) { if(this.onlyIsAgree == 3) {
// console.log('地址信息:',this.order_refund_address);
if( this.order_refund_address == '' ) { if( this.order_refund_address == '' ) {
this.$message({type:'warning',message: '请选择地址信息'}); this.$message({type:'warning',message: '请选择地址信息'});
return return
...@@ -606,15 +658,15 @@ ...@@ -606,15 +658,15 @@
ASResult(row) { ASResult(row) {
let result = '' let result = ''
if(row.status == 5) { if (row.status == 5) {
result = '退款完成,售后完成' result = '退款完成,售后完成'
}else if(row.status == -1) { } else if (row.status == -1) {
if( row.close_reason == 1 || row.close_reason == 2) { if ( row.close_reason == 1 || row.close_reason == 2) {
result = '卖家拒绝,售后关闭' result = '卖家拒绝,售后关闭'
}else if ( row.close_reason == 3 ) { }else if ( row.close_reason == 3 ) {
result = '买家未退货,售后关闭' result = '买家未退货,售后关闭'
}else if ( row.close_reason == 4 ) { }else if (row.close_reason == 6) {
result = '买家取消,售后关闭'
} }
} }
...@@ -648,6 +700,9 @@ ...@@ -648,6 +700,9 @@
formatter(time) { formatter(time) {
return dateFormat(time * 1000, 'Y-m-d H:i:s') return dateFormat(time * 1000, 'Y-m-d H:i:s')
}, },
},
destroyed() {
// clearInterval(this.timer)
} }
} }
</script> </script>
...@@ -668,6 +723,24 @@ ...@@ -668,6 +723,24 @@
margin-top: 20px; margin-top: 20px;
} }
.card-header-title {
line-height: 24px;
font-size: 18px;
color: #000;
font-weight: bold;
margin: 20px 0;
}
.blue-block {
display: inline-block;
width: 5px;
height: 24px;
background: #3A84FF;
margin: 0 9px 0 0;
border-radius: 2px;
vertical-align: bottom;
}
/* 售后信息 表格 样式 */ /* 售后信息 表格 样式 */
/deep/.el-col { /deep/.el-col {
/*border: 1px solid #eee;*/ /*border: 1px solid #eee;*/
...@@ -707,6 +780,25 @@ ...@@ -707,6 +780,25 @@
text-align: left; text-align: left;
} }
.count-down-con {
padding: 10px 20px;
margin: 0;
color: #333;
font-size: 14px;
font-weight: 400;
background: #FFF5ED;
border: 1px solid #F1914E;
}
.spec-icon-w {
color: #E6A23C;
padding: 0 5px;
}
.cd-time-span {
margin: 0 10px;
}
.as-handle-btn { .as-handle-btn {
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -18,18 +18,17 @@ ...@@ -18,18 +18,17 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
@change="applyTimeChange"
:picker-options="pickerOptions"> :picker-options="pickerOptions">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="商品ID" prop="goods_id"> <!-- <el-form-item label="商品ID" prop="goods_id">-->
<el-input <!-- <el-input-->
v-model="queryParams.goods_id" <!-- v-model="queryParams.goods_id"-->
placeholder="请输入商品id" <!-- placeholder="请输入商品id"-->
clearable <!-- clearable-->
@keyup.enter.native="handleQuery" <!-- @keyup.enter.native="handleQuery"-->
/></el-form-item> <!-- /></el-form-item>-->
<el-form-item label="商品名称" prop="goods_title"> <el-form-item label="商品名称" prop="goods_title">
<el-input <el-input
...@@ -40,7 +39,7 @@ ...@@ -40,7 +39,7 @@
/></el-form-item> /></el-form-item>
<el-form-item label="退换货类型" prop="refund_type"> <el-form-item label="退换货类型" prop="refund_type">
<el-select v-model="queryParams.refund_type" placeholder="全部类型" clearable > <el-select v-model="queryParams.refund_type" placeholder="全部类型" clearable width="120px">
<el-option v-for="item in userNeedOptions" :key="item.value" :label="item.label" <el-option v-for="item in userNeedOptions" :key="item.value" :label="item.label"
:value="item.value"></el-option> :value="item.value"></el-option>
</el-select> </el-select>
...@@ -48,6 +47,7 @@ ...@@ -48,6 +47,7 @@
<el-form-item label="订单号" prop="goods_order_sn"> <el-form-item label="订单号" prop="goods_order_sn">
<el-input <el-input
style="width:250px;"
v-model="queryParams.goods_order_sn" v-model="queryParams.goods_order_sn"
placeholder="请输入订单号" placeholder="请输入订单号"
clearable clearable
...@@ -62,14 +62,14 @@ ...@@ -62,14 +62,14 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getList">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="searchList">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 列表 --> <!-- 列表 -->
<el-table class="after-sale-table" :data="afterSaleList" :height="afterSaleHeight"> <el-table class="after-sale-table" :data="afterSaleList" :height="afterSaleHeight">
<el-table-column label="商品ID" align="center" width="150" prop="goodsId"></el-table-column> <!-- <el-table-column label="商品ID" align="center" width="150" prop="goodsId"></el-table-column>-->
<el-table-column label="商品名称" align="center" width="180" prop="title"></el-table-column> <el-table-column label="商品名称" align="center" width="280" prop="title"></el-table-column>
<el-table-column label="订单号" align="center" width="240" prop="goods_order_sn"></el-table-column> <el-table-column label="订单号" align="center" width="240" prop="goods_order_sn"></el-table-column>
<el-table-column label="退换货类型" align="center" width="180"> <el-table-column label="退换货类型" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -104,13 +104,14 @@ ...@@ -104,13 +104,14 @@
<!-- 分页 --> <!-- 分页 -->
<div class="pagination-con"> <div class="pagination-con">
<el-pagination <el-pagination
@size-change="handleSizeChange" :page-size="pageSize"
@current-change="handleCurrentChange"
:current-page="currentPage" :current-page="currentPage"
:page-sizes="[20, 40, 60, 80, 100]" :page-sizes="[20, 40, 60, 80, 100]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="total"> :total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
>
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
...@@ -127,8 +128,9 @@ ...@@ -127,8 +128,9 @@
goodsStatus: 1, goodsStatus: 1,
activeName: 'first', activeName: 'first',
queryParams: { queryParams: {
status: 0,
applyTime: [], applyTime: [],
goods_id: '', // goods_id: '',
goods_title: '', goods_title: '',
refund_type: '', refund_type: '',
goods_order_sn: '', goods_order_sn: '',
...@@ -163,9 +165,9 @@ ...@@ -163,9 +165,9 @@
}, },
// 退换货类型 // 退换货类型
userNeedOptions: [ userNeedOptions: [
{value: -1,label: '全部类型'}, {value: -1, label: '全部类型'},
{value: 1,label: '仅退款'}, {value: 1, label: '仅退款'},
{value: 2,label: '退货退款'}, {value: 2, label: '退货退款'},
], ],
// 退换货原因 // 退换货原因
needMsgOptions: [ needMsgOptions: [
...@@ -178,7 +180,7 @@ ...@@ -178,7 +180,7 @@
fullHeight: 0, fullHeight: 0,
afterSaleHeight: 200, afterSaleHeight: 200,
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 20,
total: 0, total: 0,
// 售后列表 // 售后列表
afterSaleList: [], afterSaleList: [],
...@@ -193,19 +195,20 @@ ...@@ -193,19 +195,20 @@
} }
}, },
created() { created() {
this.getList(); this.searchList();
this.$nextTick(() => { this.$nextTick(() => {
this.fullHeight = document.getElementsByClassName('box-card')[0].clientHeight this.fullHeight = document.getElementsByClassName('box-card')[0].clientHeight
}) })
}, },
mounted() { mounted() {},
},
methods: { methods: {
/** 顶部 状态页签切换 /** 顶部 状态页签切换
* 1-未处理;2-处理中;3-已完成 * 1-未处理;2-处理中;3-已完成
* */ * */
handleClick() { handleClick() {
// 搜索条件初始化
this.resetSearchParams();
switch (this.activeName) { switch (this.activeName) {
case 'first': case 'first':
this.goodsStatus = 1 this.goodsStatus = 1
...@@ -219,16 +222,18 @@ ...@@ -219,16 +222,18 @@
default: default:
break break
} }
// 搜索条件初始化
this.resetSearchParams();
// 列表 查询 // 列表 查询
this.getList(); this.getList();
}, },
/** 时间格式处理 */ /** 时间格式处理 */
applyTimeChange() { // applyTimeChange() {
if( !Array.isArray(this.queryParams.applyTime) ) { // if( !Array.isArray(this.queryParams.applyTime) ) {
this.queryParams.applyTime = []; // this.queryParams.applyTime = [];
} // }
// },
searchList() {
this.currentPage = 1;
this.getList();
}, },
/** 列表查询 */ /** 列表查询 */
getList() { getList() {
...@@ -236,35 +241,27 @@ ...@@ -236,35 +241,27 @@
page: this.currentPage, page: this.currentPage,
limit: this.pageSize, limit: this.pageSize,
status: this.goodsStatus, status: this.goodsStatus,
apply_start_time: '',
apply_end_time: '',
goods_id: this.queryParams.goods_id,
goods_title: this.queryParams.goods_title,
refund_type: '',
goods_order_sn: '',
reason: ''
} }
// console.log('queryParams:',this.queryParams);
//console.log('传向后台的参数:',params);
if( this.queryParams.applyTime.length === 2) { if( this.queryParams.applyTime && this.queryParams.applyTime.length === 2) {
params.apply_start_time = new Date(this.queryParams.applyTime[0]).getTime() / 1000 params['apply_start_time'] = new Date(this.queryParams.applyTime[0]).getTime() / 1000
params.apply_end_time = new Date(this.queryParams.applyTime[1]).getTime() / 1000 params['apply_end_time'] = new Date(this.queryParams.applyTime[1]).getTime() / 1000
}else { }
params.apply_start_time = ''
params.apply_end_time = '' if (this.queryParams.goods_title != '') {
params['goods_title'] = this.queryParams.goods_title;
} }
if (this.queryParams.refund_type === -1) { if (this.queryParams.refund_type != -1 && this.queryParams.refund_type != '') {
params.refund_type = '' params['refund_type'] = this.queryParams.refund_type;
}else {
params.refund_type = this.queryParams.refund_type;
} }
if (this.queryParams.reason === -1) { if (this.queryParams.goods_order_sn != '') {
params.reason = '' params['goods_order_sn'] = this.queryParams.goods_order_sn;
}else { }
params.reason = this.queryParams.reason;
if (this.queryParams.reason != -1 && this.queryParams.reason != '') {
params['reason'] = this.queryParams.reason;
} }
getRetreatList(params).then(res=> { getRetreatList(params).then(res=> {
...@@ -291,21 +288,21 @@ ...@@ -291,21 +288,21 @@
/** 调整 列表当前页面 最大展示条数 */ /** 调整 列表当前页面 最大展示条数 */
handleSizeChange(val) { handleSizeChange(val) {
this.pageSize = val; this.pageSize = val;
// this.getList(); this.getList();
}, },
/** 列表 跳转到 第 几 页 */ /** 列表 跳转到 第 几 页 */
handleCurrentChange(val) { handleCurrentChange(val) {
this.currentPage = val this.currentPage = val
// this.getList(); this.getList();
}, },
/** 搜索条件初始化 */ /** 搜索条件初始化 */
resetSearchParams() { resetSearchParams() {
this.pageSize = 10; this.pageSize = 20;
this.currentPage = 1; this.currentPage = 1;
// this.goodsStatus = 1;
this.queryParams = { this.queryParams = {
status: 0,
applyTime: [], applyTime: [],
goods_id: '', //goods_id: '',
goods_title: '', goods_title: '',
refund_type: '', refund_type: '',
goods_order_sn: '', goods_order_sn: '',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论