Commit cda37368 by 前端

Merge branch 'SAAS+V4.44-0902' of http://192.168.3.233:8090/saas_plus/dj-car-lif…

…e-system into SAAS+V4.44-0902
2 parents 932365c0 1834ad35
<!-- 新增提现弹窗 --> <!-- 新增提现弹窗 -->
<template> <template>
<baseDialog :dialog-config="dialogConfig" <baseDialog
:dialog-config="dialogConfig"
:is-show.sync="visible" :is-show.sync="visible"
class="accountDailog" class="accountDailog"
@handleClick="handleCashConfirm"> @handleClick="handleCashConfirm"
<el-form ref="formRef" >
<el-form
ref="formRef"
:model="infoForm" :model="infoForm"
:rules="cashRules" :rules="cashRules"
label-width="120px"> label-width="120px"
<el-form-item label="提现方:" >
prop="merchantId"> <el-form-item label="提现方:" prop="merchantId">
<el-select v-model="infoForm.merchantId" <el-select
v-model="infoForm.merchantId"
filterable filterable
style="width:310px" style="width: 310px"
placeholder="请选择提现商户" placeholder="请选择提现商户"
@change="getBankBalance"> @change="getBankBalance"
<el-option v-for="(item,index) in baseData.merchantList" >
<el-option
v-for="(item, index) in baseData.merchantList"
:key="index" :key="index"
:label="item.merchantName" :label="item.merchantName"
:value="item.merchantId" /> :value="item.merchantId"
/>
</el-select> </el-select>
<p> <p>银盛账户余额:{{ balance || balance === 0 ? balance : "-" }}</p>
银盛账户余额:{{ (balance || balance === 0)?balance:'-' }}
</p>
</el-form-item> </el-form-item>
<el-form-item label="提现金额:" <el-form-item label="提现金额:" prop="totalAmount">
prop="totalAmount"> <el-input
<el-input v-model="infoForm.totalAmount" v-model="infoForm.totalAmount"
placeholder="请输入提现金额" placeholder="请输入提现金额"
style="width: 310px" style="width: 310px"
:disabled="totalAmountDisabled" :disabled="totalAmountDisabled"
@input="handleUpgradeNum" /> @input="handleUpgradeNum"
/>
</el-form-item> </el-form-item>
<el-form-item label="财务管理员:" <el-form-item label="财务管理员:" prop="administrators">
prop="administrators"> <el-select
<el-select v-model="infoForm.administrators" v-model="infoForm.administrators"
filterable filterable
style="width:310px"> style="width: 310px"
<el-option v-for="(item,index) in baseData.administratorsList" >
<el-option
v-for="(item, index) in baseData.administratorsList"
:key="index" :key="index"
:label="item.name + ' ' + item.phone" :label="item.name + ' ' + item.phone"
:value="item.phone" /> :value="item.phone"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="验证码:" <el-form-item label="验证码:" prop="smsCode">
prop="smsCode"> <el-input
<el-input v-model="infoForm.smsCode" v-model="infoForm.smsCode"
placeholder="请输入验证码" placeholder="请输入验证码"
maxlength="6" maxlength="6"
style="width: 200px" /> style="width: 200px"
<el-button type="primary" />
<el-button
type="primary"
size="small" size="small"
@click="handleSend" @click="handleSend"
:disabled="isSend" :disabled="isSend"
class="cash-btn"> class="cash-btn"
{{ isSend ? sendMsg + '秒后,重试' : '获取验证码' }} >
{{ isSend ? sendMsg + "秒后,重试" : "获取验证码" }}
</el-button> </el-button>
<p v-show="showtips"> <p v-show="showtips">
已向尾号为{{ infoForm.administrators ? infoForm.administrators.slice(-4) : '' }}的手机号发送验证码,验证码30分钟内有效 已向尾号为{{
infoForm.administrators ? infoForm.administrators.slice(-4) : ""
}}的手机号发送验证码,验证码30分钟内有效
</p> </p>
</el-form-item> </el-form-item>
<el-form-item label="备注:" <el-form-item label="备注:" prop="remark">
prop="remark"> <el-input
<el-input v-model="infoForm.remark" v-model="infoForm.remark"
type="textarea" type="textarea"
maxlength="50" maxlength="50"
placeholder="请输入备注" placeholder="请输入备注"
show-word-limit show-word-limit
:rows="4" :rows="4"
style="width: 310px" /> style="width: 310px"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- </d2-dialog> --> <!-- </d2-dialog> -->
...@@ -76,48 +91,63 @@ ...@@ -76,48 +91,63 @@
</template> </template>
<script> <script>
import { createWithdraw } from '@api/account' import { createWithdraw } from "@api/account"
import { sendToSmsCodeApi } from '@/api/sys.base' import { sendToSmsCodeApi } from "@/api/sys.base"
import { getWithdrawTreasurerList } from '@api/transferAccountsManage' import { getWithdrawTreasurerList } from "@api/transferAccountsManage"
import { getListApi } from '@api/publicAccount' import { getListApi } from "@api/publicAccount"
import { transferAccountsRecordCreate, getBankBalance } from '@api/withdrawalManage' import {
import { limitPrice } from '@/common/format' transferAccountsRecordCreate,
import { getDjzhySubMerchant } from '@api/merchant' getBankBalance
} from "@api/withdrawalManage"
import { limitPrice } from "@/common/format"
import { getDjzhySubMerchant } from "@api/merchant"
export default { export default {
// name: 'AddDialog', // name: 'AddDialog',
data() { data() {
return { return {
dialogConfig: { dialogConfig: {
title: '新增提现', title: "新增提现",
width: '600px' width: "600px"
}, },
infoForm: { infoForm: {
administrators: '', administrators: "",
smsCode: '', smsCode: "",
remark: '', remark: "",
merchantId: '', merchantId: "",
totalAmount: '' totalAmount: ""
}, },
oldVal: { oldVal: {
totalAmount: '' totalAmount: ""
}, },
cashRules: { cashRules: {
merchantId: [{ required: true, message: '请选择提现方', trigger: 'change' }], merchantId: [
totalAmount: [{ required: true, message: '请输入金额,支持输入0~999999的数字,支持小数点后2位', trigger: 'change' }], { required: true, message: "请选择提现方", trigger: "change" }
administrators: [{ required: true, message: '请选择财务管理员', trigger: 'change' }], ],
smsCode: [{ required: true, message: '请输入验证码', trigger: 'change' }] totalAmount: [
{
required: true,
message: "请输入金额,支持输入0~999999的数字,支持小数点后2位",
trigger: "change"
}
],
administrators: [
{ required: true, message: "请选择财务管理员", trigger: "change" }
],
smsCode: [
{ required: true, message: "请输入验证码", trigger: "change" }
]
}, },
// 验证码 // 验证码
showtips: false, showtips: false,
isSend: false, isSend: false,
sendMsg: '获取验证码', sendMsg: "获取验证码",
time: '', time: "",
// 基本数据 // 基本数据
baseData: { baseData: {
administratorsList: [], administratorsList: [],
merchantList: [] merchantList: []
}, },
balance: '', balance: "",
totalAmountDisabled: true totalAmountDisabled: true
} }
}, },
...@@ -140,7 +170,7 @@ export default { ...@@ -140,7 +170,7 @@ export default {
return this.addVisible return this.addVisible
}, },
set(newVal) { set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'addVisible' }) this.$emit("dialogClose", { flag: newVal, attrName: "addVisible" })
} }
} }
}, },
...@@ -157,25 +187,26 @@ export default { ...@@ -157,25 +187,26 @@ export default {
params.pageSize = 10000 params.pageSize = 10000
params.accountStatus = 3 // 生效 params.accountStatus = 3 // 生效
params.merchantTypeList = [2, 7, -1] params.merchantTypeList = [2, 7, -1]
getListApi(params).then(res => { getListApi(params).then((res) => {
this.baseData.merchantList = res.list this.baseData.merchantList = res.list
// 获取获取嘀加智慧云子商户信息 // 获取获取嘀加智慧云子商户信息
getDjzhySubMerchant({}).then(res => { // getDjzhySubMerchant({}).then((res) => {
// 转入方选项中去除嘀加智慧云子商户 // // 转入方选项中去除嘀加智慧云子商户
this.baseData.merchantList = this.baseData.merchantList.filter((item) => item.merchantId != res.merchantId) // // this.baseData.merchantList = this.baseData.merchantList.filter((item) => item.merchantId != res.merchantId)
}) // this.baseData.merchantList = this.baseData.merchantList
// })
}) })
}, },
getAdminList() { getAdminList() {
getWithdrawTreasurerList({}).then(res => { getWithdrawTreasurerList({}).then((res) => {
this.baseData.administratorsList = res this.baseData.administratorsList = res
this.infoForm.administrators = res[0].phone this.infoForm.administrators = res[0].phone
}) })
}, },
getBankBalance(val) { getBankBalance(val) {
this.infoForm.totalAmount = '' this.infoForm.totalAmount = ""
this.balance = '' this.balance = ""
getBankBalance({ merchantId: val }).then(res => { getBankBalance({ merchantId: val }).then((res) => {
if (res || res == 0) { if (res || res == 0) {
this.balance = res this.balance = res
if (this.balance) { if (this.balance) {
...@@ -194,12 +225,19 @@ export default { ...@@ -194,12 +225,19 @@ export default {
// else { // else {
// newVal = '' // newVal = ''
// } // }
this.infoForm.totalAmount = limitPrice(newVal, this.oldVal.totalAmount, 6, 2, 0, maxVal) this.infoForm.totalAmount = limitPrice(
newVal,
this.oldVal.totalAmount,
6,
2,
0,
maxVal
)
this.oldVal.totalAmount = this.infoForm.totalAmount this.oldVal.totalAmount = this.infoForm.totalAmount
}, },
handleCashConfirm() { handleCashConfirm() {
this.$refs.formRef.validate(valid => { this.$refs.formRef.validate((valid) => {
if (valid) { if (valid) {
var params = {} var params = {}
params.remark = this.infoForm.remark params.remark = this.infoForm.remark
...@@ -218,8 +256,8 @@ export default { ...@@ -218,8 +256,8 @@ export default {
} }
console.log(params) console.log(params)
transferAccountsRecordCreate(params).then(res => { transferAccountsRecordCreate(params).then((res) => {
this.notice.okTips('操作成功') this.notice.okTips("操作成功")
this.visible = true this.visible = true
}) })
} }
...@@ -227,11 +265,11 @@ export default { ...@@ -227,11 +265,11 @@ export default {
}, },
handleSend() { handleSend() {
if (!this.infoForm.administrators) { if (!this.infoForm.administrators) {
this.notice.warningTips('请选择管理员') this.notice.warningTips("请选择管理员")
return return
} }
sendToSmsCodeApi({ phone: this.infoForm.administrators }).then((res) => { sendToSmsCodeApi({ phone: this.infoForm.administrators }).then((res) => {
this.notice.okTips('已发送,30分钟内有效') this.notice.okTips("已发送,30分钟内有效")
this.isSend = true this.isSend = true
this.showtips = true this.showtips = true
this.sendMsg = 60 this.sendMsg = 60
...@@ -251,7 +289,6 @@ export default { ...@@ -251,7 +289,6 @@ export default {
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
p { p {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!