Authored by lzhy

一件代发订单 退货申请列表导出

export default function() {
return {
showLoading: true,
show: true,
timeCount: '',
timer: null,
isAble: true,
data: {
applyType: 0,
... ... @@ -28,6 +31,8 @@ export default function() {
token: '',
timestamp: '',
salt: 'fd4ad5fcsa0de589af23234ks1923ks',
verifyCode: '',
},
shopPhone: '',
};
}
... ...
... ... @@ -34,6 +34,11 @@
<Form-item label="提现金额" prop="withdrawAmount">
<input v-model="data.withdrawAmount" :disabled="isAble" placeholder="请选择日期获取提现金额" />
</Form-item>
<Form-item label="短信验证码">
<input v-model="data.verifyCode" placeholder="短信验证码" />
<Button v-show="show" type="primary" size="large" @click="getVerifyCode">获取验证码</Button>
<Button v-show="!show" type="default" size="large" disabled> {{ timeCount }}s 后重新发送</Button>
</Form-item>
<Form-item label="提现到帐号">
<span>{{ data.withdrawAccount }}</span>
</Form-item>
... ... @@ -56,6 +61,7 @@
import moment from 'moment';
import crypto from 'util/crypto';
import FinanceService from 'services/finance/finance-service';
import ShopService from 'services/shop/shop-service';
import { WithdrawApply } from './store';
export default {
... ... @@ -67,6 +73,7 @@ export default {
token: this.$user.token,
timestamps: Math.round(new Date().getTime() / 1000),
};
this.shopService = new ShopService();
this.financeService = new FinanceService();
this.financeService
.shopWithdrawApplyInit(params)
... ... @@ -97,9 +104,89 @@ export default {
this.$Message.error('请求出错');
this.showLoading = false;
});
this.getShopInfo();
},
mounted() {},
methods: {
//获取店铺信息
getShopInfo() {
this.shopService.getShop().then(res => {
const { customerTel } = res.data;
this.shopPhone = customerTel;
});
},
//验证短信验证码
verifySmsCode(verifyCode) {
if (!verifyCode || verifyCode === '') {
this.$Notice.error({
title: '提交错误',
desc: '验证码不能为空',
});
return false;
}
this.financeService.verifySmsCode({ phones: this.shopPhone, verifyCode }).then(res => {
if (res.code !== 200) {
this.$Notice.error({
title: '提交错误',
desc: res.message,
});
return false;
} else {
return true;
}
});
},
//获取短信验证码
getVerifyCode() {
if (this.shopPhone === '') {
this.$Notice.error({
title: '发送失败',
desc: '店铺绑定手机为空,请先绑定手机',
});
return false;
}
this.validateBtn();
const smsParams = {
phones: this.shopPhone,
project: 'shop',
className: 'withdraw',
methodName: 'getVerifyCode',
};
return this.financeService.sendShopVerifyCode(smsParams).then(result => {
if (result.code === 200) {
this.$Notice.success({
title: '发送成功',
desc: '验证码已发送到您手机!',
});
} else {
this.$Notice.error({
title: '发送失败',
desc: result.message,
});
}
});
},
// 点击验证码后倒计时
validateBtn() {
const timeCount = 60;
if (!this.timer) {
this.timeCount = timeCount;
this.show = false;
this.timer = setInterval(() => {
if (this.timeCount > 0 && this.timeCount <= timeCount) {
this.timeCount--;
} else {
this.show = true;
clearInterval(this.timer);
this.timer = null;
}
}, 1000);
}
},
backList() {
this.$router.push({ name: 'finance.withdraw.withdrawlist' });
},
... ... @@ -130,10 +217,20 @@ export default {
params.sign = crypto.md5(arrParams.join('|'));
params.account = this.$user.name;
params.timeout = 60000; // 提现超时时间60秒
// 短信验证码
params.verifyCode = this.data.verifyCode;
return params;
},
save() {
if (!this.beforeSave()) {
return false;
}
const applyParams = this.beforeSave();
if (!this.verifySmsCode(applyParams.verifyCode)) {
return false;
}
this.$Loading.start();
this.submitDisabled = true;
return this.financeService.shopWithdrawApply(applyParams).then(result => {
... ...
... ... @@ -20,9 +20,16 @@
</Option>
</Select>
</filter-item>
<filter-item label="开始时间">
<Date-picker v-model="beginTimeModel" type="datetime" placeholder="创建开始时间" clearable></Date-picker>
</filter-item>
<filter-item label="结束时间">
<Date-picker v-model="endTimeModel" type="datetime" placeholder="创建结束时间" clearable></Date-picker>
</filter-item>
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button @click="reset">全部</Button>
<Button type="warning" @click="exportList">导出</Button>
</filter-item>
</layout-filter>
<layout-list>
... ... @@ -40,6 +47,7 @@ import { ListTabs, DataTable } from './components';
import { OrderService } from 'services/order';
import _ from 'lodash';
import { OrderConfig } from '../configs';
import qs from 'querystringify';
export default {
components: { ListTabs, DataTable },
data() {
... ... @@ -55,7 +63,11 @@ export default {
pageNo: 1,
orderStatusStr: '',
orderStatusType: 0,
createBeginTime: '',
createEndTime: '',
},
beginTimeModel: '',
endTimeModel: '',
tableData: [],
orderStatusArr: OrderConfig.orderStatus,
pageData: {
... ... @@ -64,6 +76,20 @@ export default {
},
};
},
watch: {
beginTimeModel: {
handler(newValue) {
this.query.createBeginTime = new Date(newValue).getTime() / 1000;
},
deep: true,
},
endTimeModel: {
handler(newValue) {
this.query.createEndTime = new Date(newValue).getTime() / 1000;
},
deep: true,
},
},
created() {
this.orderService = new OrderService();
this.search();
... ... @@ -95,6 +121,12 @@ export default {
this.query.pageNo = 1;
this.search();
},
//导出列表
exportList() {
const queryString = qs.stringify(this.query, true);
const href = `${OrderService.exportOrdersByStatus}?${queryString}`;
window.open(href, '_blank');
},
},
};
</script>
... ...
... ... @@ -21,9 +21,16 @@
</Option>
</Select>
</filter-item>
<filter-item label="开始时间">
<Date-picker v-model="beginTimeModel" type="datetime" placeholder="申请开始时间" clearable></Date-picker>
</filter-item>
<filter-item label="结束时间">
<Date-picker v-model="endTimeModel" type="datetime" placeholder="申请结束时间" clearable></Date-picker>
</filter-item>
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button @click="reset">全部</Button>
<Button type="warning" @click="exportList">导出</Button>
</filter-item>
</layout-filter>
<layout-list>
... ... @@ -39,11 +46,14 @@ import { ReturnedListTable } from '../components';
import { ReturnedService } from 'services/order';
import { OrderConfig } from 'pages/order/configs';
import _ from 'lodash';
import qs from 'querystringify';
export default {
components: { ReturnedListTable },
data() {
return {
beginTimeModel: '',
endTimeModel: '',
paymentStatusArr: OrderConfig.paymentStatus,
query: {
orderCode: '',
... ... @@ -54,6 +64,8 @@ export default {
pageNo: 1,
queryType: 1,
shopStatus: '-1',
createBeginTime: '',
createEndTime: '',
},
returnedGoodsShopStatus: OrderConfig.returnedGoodsShopStatus,
pageData: {
... ... @@ -63,6 +75,20 @@ export default {
tableData: [],
};
},
watch: {
beginTimeModel: {
handler(newValue) {
this.query.createBeginTime = new Date(newValue).getTime() / 1000;
},
deep: true,
},
endTimeModel: {
handler(newValue) {
this.query.createEndTime = new Date(newValue).getTime() / 1000;
},
deep: true,
},
},
created() {
this.ReturnedService = new ReturnedService();
this.search();
... ... @@ -90,8 +116,16 @@ export default {
this.query.pageSize = 20;
this.query.pageNo = 1;
this.query.orderStatusStr = '';
this.beginTimeModel = '';
this.endTimeModel = '';
this.search();
},
//导出列表
exportList() {
const queryString = qs.stringify(this.query, true);
const href = `${ReturnedService.exportReturnedGoods}?${queryString}`;
window.open(href, '_blank');
},
},
};
</script>
... ...
... ... @@ -16,6 +16,8 @@ const apiUrl = {
shopWithdrawApplyInit: '/erp/shopWithdrawApplyInit',
shopGetAvailableAmount: '/erp/shopGetAvailableAmount',
shopWithdrawApply: '/erp/shopWithdrawApply',
sendShopVerifyCode: '/erp/sendShopVerifyCode',
verifySmsCode: '/erp/verifySmsCode',
};
class FinanceService extends Service {
... ... @@ -145,6 +147,24 @@ class FinanceService extends Service {
shopWithdrawApply(params) {
return this.post(apiUrl.shopWithdrawApply, params);
}
/**
* 获取提现短信验证码
* @param params
* @return {*}
*/
sendShopVerifyCode(params) {
return this.post(apiUrl.sendShopVerifyCode, params);
}
/**
* 验证短信验证码
* @param params
* @return {*}
*/
verifySmsCode(params) {
return this.post(apiUrl.verifySmsCode, params);
}
}
FinanceService.exportBalanceList = '/Api/erp/exportBalanceList'; // 导出对账单列表, 结算单列表
... ...
... ... @@ -127,6 +127,8 @@ const domainApis = {
shopWithdrawApplyInit: '/erp-gateway-web/shop/withdraw/init', //提现页面初始数据
shopGetAvailableAmount: '/erp-gateway-web/shop/withdraw/getAvailableAmount', //根据店铺ID,时间获取可用的提现金额
shopWithdrawApply: '/erp-gateway-web/shop/withdraw/apply', //资金操作明细-申请提现
sendShopVerifyCode: '/erp-gateway-web/sms/sendVerificationCode', //获取短信验证码
verifySmsCode: '/erp-gateway-web/sms/verifySmsCode', // 验证短信验证码
},
platform: {
queryShopsByAdminPid: '/SellerShopController/queryShopsByAdminPid',
... ...