This commit is contained in:
wangyan 2024-08-26 15:13:35 +08:00
parent 1128c9e7bd
commit 6196d63286
4 changed files with 401 additions and 295 deletions

View File

@ -72,7 +72,7 @@
v-for="item in afterSalesTypeArr"
:key="item.label"
:label="item.label"
:value="item.value"
:value="item.label"
/>
</el-select>
@ -98,7 +98,21 @@
</el-col>
<el-col :span="12">
<el-form-item label="售后状态">
<el-input v-model="form.afterSalesStatus" style="width: 370px;" />
<el-select
v-model="query.afterSalesStatus"
clearable
placeholder="售后类型"
class="filter-item"
style="width: 370px"
>
<el-option
v-for="item in afterSalesTypeArr"
:key="item.label"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">

View File

@ -1,152 +1,181 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="售后单号" >
<el-input v-model="form.afterSalesNumber" style="width: 370px;"/>
<el-dialog
:append-to-body="true"
:close-on-click-modal="false"
:before-close="cancel"
:visible.sync="dialog"
:title="isAdd ? '新增' : '编辑'"
width="500px"
>
<el-form
ref="form"
:model="form"
:rules="rules"
size="small"
label-width="80px"
>
<el-form-item label="售后单号">
<el-input v-model="form.afterSalesNumber" style="width: 370px;" />
</el-form-item>
<el-form-item label="订单号" >
<el-input v-model="form.orderNumber" style="width: 370px;"/>
<el-form-item label="订单号">
<el-input v-model="form.orderNumber" style="width: 370px;" />
</el-form-item>
<el-form-item label="商品单号" >
<el-input v-model="form.productNumber" style="width: 370px;"/>
<el-form-item label="商品单号">
<el-input v-model="form.productNumber" style="width: 370px;" />
</el-form-item>
<el-form-item label="商品名称" >
<el-input v-model="form.productName" style="width: 370px;"/>
<el-form-item label="商品名称">
<el-input v-model="form.productName" style="width: 370px;" />
</el-form-item>
<el-form-item label="店铺名字" >
<el-input v-model="form.shopName" style="width: 370px;"/>
<el-form-item label="店铺名字">
<el-input v-model="form.shopName" style="width: 370px;" />
</el-form-item>
<el-form-item label="商品ID" >
<el-input v-model="form.productId" style="width: 370px;"/>
<el-form-item label="商品ID">
<el-input v-model="form.productId" style="width: 370px;" />
</el-form-item>
<el-form-item label="应付金额(元)" >
<el-input v-model="form.amountDueCny" style="width: 370px;"/>
<el-form-item label="应付金额(元)">
<el-input v-model="form.amountDueCny" style="width: 370px;" />
</el-form-item>
<el-form-item label="商品运费(元)" >
<el-input v-model="form.shippingFeeCny" style="width: 370px;"/>
<el-form-item label="商品运费(元)">
<el-input v-model="form.shippingFeeCny" style="width: 370px;" />
</el-form-item>
<el-form-item label="支付优惠(元)" >
<el-input v-model="form.paymentDiscountCny" style="width: 370px;"/>
<el-form-item label="支付优惠(元)">
<el-input v-model="form.paymentDiscountCny" style="width: 370px;" />
</el-form-item>
<el-form-item label="商品发货状态" >
<el-input v-model="form.shippingStatus" style="width: 370px;"/>
<el-form-item label="商品发货状态">
<el-input v-model="form.shippingStatus" style="width: 370px;" />
</el-form-item>
<el-form-item label="售后类型" >
<el-input v-model="form.afterSalesType" style="width: 370px;"/>
<el-form-item label="售后类型">
<el-input v-model="form.afterSalesType" style="width: 370px;" />
</el-form-item>
<el-form-item label="退商品金额(元)" >
<el-input v-model="form.refundProductAmountCny" style="width: 370px;"/>
<el-form-item label="退商品金额(元)">
<el-input v-model="form.refundProductAmountCny" style="width: 370px;" />
</el-form-item>
<el-form-item label="退运费金额(元)" >
<el-input v-model="form.refundShippingFeeCny" style="width: 370px;"/>
<el-form-item label="退运费金额(元)">
<el-input v-model="form.refundShippingFeeCny" style="width: 370px;" />
</el-form-item>
<el-form-item label="退支付优惠(元)" >
<el-input v-model="form.refundPaymentDiscountCny" style="width: 370px;"/>
<el-form-item label="退支付优惠(元)">
<el-input
v-model="form.refundPaymentDiscountCny"
style="width: 370px;"
/>
</el-form-item>
<el-form-item label="售后状态" >
<el-input v-model="form.afterSalesStatus" style="width: 370px;"/>
<el-form-item label="售后状态">
<el-input v-model="form.afterSalesStatus" style="width: 370px;" />
</el-form-item>
<el-form-item label="售后申请时间" >
<el-input v-model="form.applicationTime" style="width: 370px;"/>
<el-form-item label="售后申请时间">
<el-input v-model="form.applicationTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="退款方式" >
<el-input v-model="form.refundMethod" style="width: 370px;"/>
<el-form-item label="退款方式">
<el-input v-model="form.refundMethod" style="width: 370px;" />
</el-form-item>
<el-form-item label="售后原因" >
<el-input v-model="form.refundReason" style="width: 370px;"/>
<el-form-item label="售后原因">
<el-input v-model="form.refundReason" style="width: 370px;" />
</el-form-item>
<el-form-item label="售后原因标签" >
<el-input v-model="form.refundReasonTag" style="width: 370px;"/>
<el-form-item label="售后原因标签">
<el-input v-model="form.refundReasonTag" style="width: 370px;" />
</el-form-item>
<el-form-item label="退货物流单号" >
<el-input v-model="form.returnLogisticsNumber" style="width: 370px;"/>
<el-form-item label="退货物流单号">
<el-input v-model="form.returnLogisticsNumber" style="width: 370px;" />
</el-form-item>
<el-form-item label="退货异常" >
<el-input v-model="form.returnAbnormality" style="width: 370px;"/>
<el-form-item label="退货异常">
<el-input v-model="form.returnAbnormality" style="width: 370px;" />
</el-form-item>
<el-form-item label="退货发货时间" >
<el-input v-model="form.returnShippingTime" style="width: 370px;"/>
<el-form-item label="退货发货时间">
<el-input v-model="form.returnShippingTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="退货物流公司" >
<el-input v-model="form.returnLogisticsCompany" style="width: 370px;"/>
<el-form-item label="退货物流公司">
<el-input v-model="form.returnLogisticsCompany" style="width: 370px;" />
</el-form-item>
<el-form-item label="自动处理截止时间" >
<el-input v-model="form.autoProcessDeadline" style="width: 370px;"/>
<el-form-item label="自动处理截止时间">
<el-input v-model="form.autoProcessDeadline" style="width: 370px;" />
</el-form-item>
<el-form-item label="同意售后申请时间" >
<el-input v-model="form.approvalTime" style="width: 370px;"/>
<el-form-item label="同意售后申请时间">
<el-input v-model="form.approvalTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="商家退款时间" >
<el-input v-model="form.merchantRefundTime" style="width: 370px;"/>
<el-form-item label="商家退款时间">
<el-input v-model="form.merchantRefundTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="用户到账时间" >
<el-input v-model="form.customerReceiptTime" style="width: 370px;"/>
<el-form-item label="用户到账时间">
<el-input v-model="form.customerReceiptTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="售后关闭时间" >
<el-input v-model="form.closureTime" style="width: 370px;"/>
<el-form-item label="售后关闭时间">
<el-input v-model="form.closureTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="商家退货地址" >
<el-input v-model="form.merchantReturnAddress" style="width: 370px;"/>
<el-form-item label="商家退货地址">
<el-input v-model="form.merchantReturnAddress" style="width: 370px;" />
</el-form-item>
<el-form-item label="商家退货联系人姓名" >
<el-input v-model="form.merchantContactName" style="width: 370px;"/>
<el-form-item label="商家退货联系人姓名">
<el-input v-model="form.merchantContactName" style="width: 370px;" />
</el-form-item>
<el-form-item label="商家退货联系人电话" >
<el-input v-model="form.merchantContactPhone" style="width: 370px;"/>
<el-form-item label="商家退货联系人电话">
<el-input v-model="form.merchantContactPhone" style="width: 370px;" />
</el-form-item>
<el-form-item label="仲裁状态" >
<el-input v-model="form.arbitrationStatus" style="width: 370px;"/>
<el-form-item label="仲裁状态">
<el-input v-model="form.arbitrationStatus" style="width: 370px;" />
</el-form-item>
<el-form-item label="纠纷责任方" >
<el-input v-model="form.disputeResponsibleParty" style="width: 370px;"/>
<el-form-item label="纠纷责任方">
<el-input
v-model="form.disputeResponsibleParty"
style="width: 370px;"
/>
</el-form-item>
<el-form-item label="是否极速退款" >
<el-input v-model="form.isRapidRefund" style="width: 370px;"/>
<el-form-item label="是否极速退款">
<el-input v-model="form.isRapidRefund" style="width: 370px;" />
</el-form-item>
<el-form-item label="是否拒签后退款" >
<el-input v-model="form.isRejectionRefund" style="width: 370px;"/>
<el-form-item label="是否拒签后退款">
<el-input v-model="form.isRejectionRefund" style="width: 370px;" />
</el-form-item>
<el-form-item label="发货物流单号" >
<el-input v-model="form.deliveryLogisticsNumber" style="width: 370px;"/>
<el-form-item label="发货物流单号">
<el-input
v-model="form.deliveryLogisticsNumber"
style="width: 370px;"
/>
</el-form-item>
<el-form-item label="发货物流状态" >
<el-input v-model="form.deliveryLogisticsStatus" style="width: 370px;"/>
<el-form-item label="发货物流状态">
<el-input
v-model="form.deliveryLogisticsStatus"
style="width: 370px;"
/>
</el-form-item>
<el-form-item label="退货物流状态" >
<el-input v-model="form.returnLogisticsStatus" style="width: 370px;"/>
<el-form-item label="退货物流状态">
<el-input v-model="form.returnLogisticsStatus" style="width: 370px;" />
</el-form-item>
<el-form-item label="售后完结时间" >
<el-input v-model="form.finalizationTime" style="width: 370px;"/>
<el-form-item label="售后完结时间">
<el-input v-model="form.finalizationTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="用户售后说明" >
<el-input v-model="form.customerStatement" style="width: 370px;"/>
<el-form-item label="用户售后说明">
<el-input v-model="form.customerStatement" style="width: 370px;" />
</el-form-item>
<el-form-item label="售后备注" >
<el-input v-model="form.comments" style="width: 370px;"/>
<el-form-item label="售后备注">
<el-input v-model="form.comments" style="width: 370px;" />
</el-form-item>
<el-form-item label="操作人" >
<el-input v-model="form.operator" style="width: 370px;"/>
<el-form-item label="操作人">
<el-input v-model="form.operator" style="width: 370px;" />
</el-form-item>
<el-form-item label="协商记录" >
<el-input v-model="form.negotiationRecords" style="width: 370px;"/>
<el-form-item label="协商记录">
<el-input v-model="form.negotiationRecords" style="width: 370px;" />
</el-form-item>
<el-form-item label="处理结果" >
<el-input v-model="form.resolution" style="width: 370px;"/>
<el-form-item label="处理结果">
<el-input v-model="form.resolution" style="width: 370px;" />
</el-form-item>
<el-form-item label="处理结果时间" >
<el-input v-model="form.resolutionTime" style="width: 370px;"/>
<el-form-item label="处理结果时间">
<el-input v-model="form.resolutionTime" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit"
>确认</el-button
>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/douyinAfterSales'
import { add, edit } from "@/api/douyinAfterSales";
import initDict from "@/mixins/initDict";
export default {
mixins: [initDict],
props: {
isAdd: {
type: Boolean,
@ -155,155 +184,165 @@ export default {
},
data() {
return {
loading: false, dialog: false,
loading: false,
dialog: false,
afterSalesTypeArr: [],
form: {
id: '',
afterSalesNumber: '',
orderNumber: '',
productNumber: '',
productName: '',
shopName: '',
productId: '',
amountDueCny: '',
shippingFeeCny: '',
paymentDiscountCny: '',
shippingStatus: '',
afterSalesType: '',
refundProductAmountCny: '',
refundShippingFeeCny: '',
refundPaymentDiscountCny: '',
afterSalesStatus: '',
applicationTime: '',
refundMethod: '',
refundReason: '',
refundReasonTag: '',
returnLogisticsNumber: '',
returnAbnormality: '',
returnShippingTime: '',
returnLogisticsCompany: '',
autoProcessDeadline: '',
approvalTime: '',
merchantRefundTime: '',
customerReceiptTime: '',
closureTime: '',
merchantReturnAddress: '',
merchantContactName: '',
merchantContactPhone: '',
arbitrationStatus: '',
disputeResponsibleParty: '',
isRapidRefund: '',
isRejectionRefund: '',
deliveryLogisticsNumber: '',
deliveryLogisticsStatus: '',
returnLogisticsStatus: '',
finalizationTime: '',
customerStatement: '',
comments: '',
operator: '',
negotiationRecords: '',
resolution: '',
resolutionTime: ''
id: "",
afterSalesNumber: "",
orderNumber: "",
productNumber: "",
productName: "",
shopName: "",
productId: "",
amountDueCny: "",
shippingFeeCny: "",
paymentDiscountCny: "",
shippingStatus: "",
afterSalesType: "",
refundProductAmountCny: "",
refundShippingFeeCny: "",
refundPaymentDiscountCny: "",
afterSalesStatus: "",
applicationTime: "",
refundMethod: "",
refundReason: "",
refundReasonTag: "",
returnLogisticsNumber: "",
returnAbnormality: "",
returnShippingTime: "",
returnLogisticsCompany: "",
autoProcessDeadline: "",
approvalTime: "",
merchantRefundTime: "",
customerReceiptTime: "",
closureTime: "",
merchantReturnAddress: "",
merchantContactName: "",
merchantContactPhone: "",
arbitrationStatus: "",
disputeResponsibleParty: "",
isRapidRefund: "",
isRejectionRefund: "",
deliveryLogisticsNumber: "",
deliveryLogisticsStatus: "",
returnLogisticsStatus: "",
finalizationTime: "",
customerStatement: "",
comments: "",
operator: "",
negotiationRecords: "",
resolution: "",
resolutionTime: ""
},
rules: {
}
}
rules: {}
};
},
created() {
this.getDictMap("after_sale_type")
.then(res => {
this.afterSalesTypeArr = res["after_sale_type"];
})
.catch(err => {});
},
methods: {
cancel() {
this.resetForm()
this.resetForm();
},
doSubmit() {
this.loading = true
this.loading = true;
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
this.doAdd();
} else this.doEdit();
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
add(this.form)
.then(res => {
this.resetForm();
this.$notify({
title: "添加成功",
type: "success",
duration: 2500
});
this.loading = false;
this.$parent.init();
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
.catch(err => {
this.loading = false;
console.log(err.response.data.message);
});
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
edit(this.form)
.then(res => {
this.resetForm();
this.$notify({
title: "修改成功",
type: "success",
duration: 2500
});
this.loading = false;
this.$parent.init();
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
.catch(err => {
this.loading = false;
console.log(err.response.data.message);
});
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.dialog = false;
this.$refs["form"].resetFields();
this.form = {
id: '',
afterSalesNumber: '',
orderNumber: '',
productNumber: '',
productName: '',
shopName: '',
productId: '',
amountDueCny: '',
shippingFeeCny: '',
paymentDiscountCny: '',
shippingStatus: '',
afterSalesType: '',
refundProductAmountCny: '',
refundShippingFeeCny: '',
refundPaymentDiscountCny: '',
afterSalesStatus: '',
applicationTime: '',
refundMethod: '',
refundReason: '',
refundReasonTag: '',
returnLogisticsNumber: '',
returnAbnormality: '',
returnShippingTime: '',
returnLogisticsCompany: '',
autoProcessDeadline: '',
approvalTime: '',
merchantRefundTime: '',
customerReceiptTime: '',
closureTime: '',
merchantReturnAddress: '',
merchantContactName: '',
merchantContactPhone: '',
arbitrationStatus: '',
disputeResponsibleParty: '',
isRapidRefund: '',
isRejectionRefund: '',
deliveryLogisticsNumber: '',
deliveryLogisticsStatus: '',
returnLogisticsStatus: '',
finalizationTime: '',
customerStatement: '',
comments: '',
operator: '',
negotiationRecords: '',
resolution: '',
resolutionTime: ''
}
id: "",
afterSalesNumber: "",
orderNumber: "",
productNumber: "",
productName: "",
shopName: "",
productId: "",
amountDueCny: "",
shippingFeeCny: "",
paymentDiscountCny: "",
shippingStatus: "",
afterSalesType: "",
refundProductAmountCny: "",
refundShippingFeeCny: "",
refundPaymentDiscountCny: "",
afterSalesStatus: "",
applicationTime: "",
refundMethod: "",
refundReason: "",
refundReasonTag: "",
returnLogisticsNumber: "",
returnAbnormality: "",
returnShippingTime: "",
returnLogisticsCompany: "",
autoProcessDeadline: "",
approvalTime: "",
merchantRefundTime: "",
customerReceiptTime: "",
closureTime: "",
merchantReturnAddress: "",
merchantContactName: "",
merchantContactPhone: "",
arbitrationStatus: "",
disputeResponsibleParty: "",
isRapidRefund: "",
isRejectionRefund: "",
deliveryLogisticsNumber: "",
deliveryLogisticsStatus: "",
returnLogisticsStatus: "",
finalizationTime: "",
customerStatement: "",
comments: "",
operator: "",
negotiationRecords: "",
resolution: "",
resolutionTime: ""
};
}
}
}
};
</script>
<style scoped>
</style>
<style scoped></style>

View File

@ -1,32 +1,70 @@
<template>
<div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px"
class="login-form">
<el-form
ref="loginForm"
:model="loginForm"
:rules="loginRules"
label-position="left"
label-width="0px"
class="login-form"
>
<h3 class="title">襄岳科技-{{ name }}</h3>
<el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
<el-input
v-model="loginForm.username"
type="text"
auto-complete="off"
placeholder="账号"
>
<svg-icon
slot="prefix"
icon-class="user"
class="el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="loginForm.password" type="password" auto-complete="off" placeholder="密码"
@keyup.enter.native="handleLogin">
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
<el-input
v-model="loginForm.password"
type="password"
auto-complete="off"
placeholder="密码"
@keyup.enter.native="handleLogin"
>
<svg-icon
slot="prefix"
icon-class="password"
class="el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<el-form-item prop="code">
<el-input v-model="loginForm.code" auto-complete="off" placeholder="验证码" style="width: 63%"
@keyup.enter.native="handleLogin">
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
<el-input
v-model="loginForm.code"
auto-complete="off"
placeholder="验证码"
style="width: 63%"
@keyup.enter.native="handleLogin"
>
<svg-icon
slot="prefix"
icon-class="validCode"
class="el-input__icon input-icon"
/>
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode">
<img :src="codeUrl" @click="getCode" />
</div>
</el-form-item>
<!-- <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住我</el-checkbox> -->
<el-form-item style="width:100%;">
<el-button :loading="loading" size="medium" type="primary" style="width:100%;"
@click.native.prevent="handleLogin">
<el-button
:loading="loading"
size="medium"
type="primary"
style="width:100%;"
@click.native.prevent="handleLogin"
>
<span v-if="!loading"> </span>
<span v-else> 中...</span>
</el-button>
@ -36,77 +74,81 @@
<div v-if="$store.state.settings.showFooter" id="el-login-footer">
<span v-html="$store.state.settings.footerTxt" />
<span> </span>
<a href="http://www.beian.miit.gov.cn" target="_blank">{{ $store.state.settings.caseNumber }}</a>
<a href="http://www.beian.miit.gov.cn" target="_blank">{{
$store.state.settings.caseNumber
}}</a>
</div>
</div>
</template>
<script>
import { encrypt } from '@/utils/rsaEncrypt'
import Config from '@/config'
import { encrypt } from "@/utils/rsaEncrypt";
import Config from "@/config";
import { mapGetters } from "vuex";
import { getCodeImg } from '@/api/login'
import Cookies from 'js-cookie'
import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie";
export default {
name: 'Login',
name: "Login",
data() {
return {
codeUrl: '',
cookiePass: '',
codeUrl: "",
cookiePass: "",
loginForm: {
username: '',
password: '',
username: "",
password: "",
rememberMe: false,
code: '',
uuid: ''
code: "",
uuid: ""
},
loginRules: {
username: [{ required: true, trigger: 'blur', message: '用户名不能为空' }],
password: [{ required: true, trigger: 'blur', message: '密码不能为空' }],
code: [{ required: true, trigger: 'change', message: '验证码不能为空' }]
username: [
{ required: true, trigger: "blur", message: "用户名不能为空" }
],
password: [
{ required: true, trigger: "blur", message: "密码不能为空" }
],
code: [{ required: true, trigger: "change", message: "验证码不能为空" }]
},
loading: false,
redirect: undefined
}
};
},
watch: {
$route: {
handler: function (route) {
this.redirect = route.query && route.query.redirect
handler: function(route) {
this.redirect = route.query && route.query.redirect;
},
immediate: true
}
},
created() {
this.getCode()
this.getCookie()
this.getCode();
this.getCookie();
},
computed: {
...mapGetters([
'name'
])
...mapGetters(["name"])
},
methods: {
getCode() {
getCodeImg().then(res => {
this.codeUrl = res.img
this.loginForm.uuid = res.uuid
})
this.codeUrl = res.img;
this.loginForm.uuid = res.uuid;
});
},
getCookie() {
const username = Cookies.get('username')
let password = Cookies.get('password')
const rememberMe = Cookies.get('rememberMe')
const username = Cookies.get("username");
let password = Cookies.get("password");
const rememberMe = Cookies.get("rememberMe");
// cookie
this.cookiePass = password === undefined ? '' : password
password = password === undefined ? this.loginForm.password : password
this.cookiePass = password === undefined ? "" : password;
password = password === undefined ? this.loginForm.password : password;
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password: password,
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
code: ''
}
code: ""
};
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
@ -116,37 +158,46 @@ export default {
rememberMe: this.loginForm.rememberMe,
code: this.loginForm.code,
uuid: this.loginForm.uuid
}
};
if (user.password !== this.cookiePass) {
user.password = encrypt(user.password)
user.password = encrypt(user.password);
}
if (valid) {
this.loading = true
this.loading = true;
if (user.rememberMe) {
Cookies.set('username', user.username, { expires: Config.passCookieExpires })
Cookies.set('password', user.password, { expires: Config.passCookieExpires })
Cookies.set('rememberMe', user.rememberMe, { expires: Config.passCookieExpires })
Cookies.set("username", user.username, {
expires: Config.passCookieExpires
});
Cookies.set("password", user.password, {
expires: Config.passCookieExpires
});
Cookies.set("rememberMe", user.rememberMe, {
expires: Config.passCookieExpires
});
} else {
Cookies.remove('username')
Cookies.remove('password')
Cookies.remove('rememberMe')
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove("rememberMe");
}
this.$store.dispatch('Login', user).then(() => {
this.loading = false
this.$router.push({ path: this.redirect || '/' })
localStorage.setItem('name', user.username);
}).catch(() => {
this.loading = false
this.getCode()
})
this.$store
.dispatch("Login", user)
.then(() => {
this.loading = false;
this.$router.push({ path: this.redirect || "/" });
localStorage.setItem("name", user.username);
})
.catch(() => {
this.loading = false;
this.getCode();
});
} else {
console.log('error submit!!')
return false
console.log("error submit!!");
return false;
}
})
});
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
@ -201,7 +252,7 @@ export default {
img {
cursor: pointer;
vertical-align: middle
vertical-align: middle;
}
}
</style>

View File

@ -298,7 +298,9 @@ export default {
},
jinglirun(row) {
const data1 = this.maolirun(row);
const data2 = this.fapiaochengben(row);
debugger;
const data3 = this.$math.subtract(data1, data2);
return data3.toFixed(2);
},