fix: 增加账户状态功能优化完善。
This commit is contained in:
@@ -20,6 +20,11 @@
|
||||
<u--input v-model="form.code" placeholder="请填写账号"
|
||||
inputAlign="right" border="none"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="账户状态" required prop="statusName" @click="handleShowStatus">
|
||||
<u--input v-model="form.statusName" disabled disabledColor="#ffffff" placeholder="请选择账户状态"
|
||||
inputAlign="right" border="none"></u--input>
|
||||
<u-icon slot="right" name="arrow-down"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="密码" prop="password" >
|
||||
<u--input v-model="form.password" placeholder="请填写密码"
|
||||
inputAlign="right" border="none"></u--input>
|
||||
@@ -51,6 +56,8 @@
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
<u-picker itemHeight="88" :show="showDebitCard" :columns="debitCardList" keyName="nameCodeAvailableLimit" @cancel="handleDebitCardCancel"
|
||||
@confirm="handleDebitCardConfirm"></u-picker>
|
||||
<u-picker itemHeight="88" :show="showStatus" :columns="statusList" keyName="dictLabel" @cancel="handleStatusCancel"
|
||||
@confirm="handleStatusConfirm"></u-picker>
|
||||
<u-datetime-picker
|
||||
:show="datePickShow"
|
||||
mode="date"
|
||||
@@ -65,6 +72,7 @@
|
||||
<script setup>
|
||||
import { getFutureStocks, addFutureStocks, updateFutureStocks } from '@/api/invest/futureStocks'
|
||||
import { listAccounts } from '@/api/invest/accounts'
|
||||
import { getDicts } from '@/api/system/dict/data.js'
|
||||
const { proxy } = getCurrentInstance()
|
||||
import dayjs from 'dayjs'
|
||||
import {onLoad,onReady} from "@dcloudio/uni-app";
|
||||
@@ -75,6 +83,8 @@ const showDebitCard = ref(false)
|
||||
const title = ref("股票账户管理")
|
||||
const debitCardList = ref([])
|
||||
const dateType = ref(1)
|
||||
const showStatus = ref(false)
|
||||
const statusList = ref([])
|
||||
const data = reactive({
|
||||
form: {
|
||||
id: null,
|
||||
@@ -94,18 +104,21 @@ const data = reactive({
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
delFlag: null,
|
||||
remark: null
|
||||
remark: null,
|
||||
status: '1',
|
||||
statusName: '正常使用'
|
||||
},
|
||||
queryDebitCardParams: {
|
||||
pageNum: 1,
|
||||
type: '1',
|
||||
state: '1',
|
||||
status: '1',
|
||||
pageSize: 1000
|
||||
},
|
||||
// dateType:'1',
|
||||
rules: {
|
||||
name: [{ type: 'string', required: true, message: '股票账户名称不能为空', trigger: ['change', 'blur'] }],
|
||||
code: [{ type: 'string', required: true, message: '账号不能为空', trigger: ['change', 'blur'] }],
|
||||
statusName: [{ type: 'string', required: true, message: '账户状态不能为空', trigger: ['change', 'blur'] }],
|
||||
}
|
||||
})
|
||||
const { form, queryDebitCardParams, rules} = toRefs(data)
|
||||
@@ -124,6 +137,10 @@ onLoad((option) => {
|
||||
form.value.effectiveDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
|
||||
})
|
||||
function getDict() {
|
||||
// 类型
|
||||
getDicts('account_status').then(res => {
|
||||
statusList.value =[res.data]
|
||||
})
|
||||
// 类型
|
||||
listAccounts(queryDebitCardParams.value).then((response) => {
|
||||
debitCardList.value = [response.rows]
|
||||
@@ -132,10 +149,22 @@ onLoad((option) => {
|
||||
if(form.value.id!=null){
|
||||
getFutureStocks(form.value.id).then(res => {
|
||||
form.value = res.data
|
||||
// 类型
|
||||
getDicts('account_status').then(result => {
|
||||
form.value.statusName=dictStr(form.value.status, result.data)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function dictStr(val, arr) {
|
||||
let str = ''
|
||||
arr.map(item => {
|
||||
if (item.dictValue === val) {
|
||||
str = item.dictLabel
|
||||
}
|
||||
})
|
||||
return str
|
||||
}
|
||||
function handleDebitCard() {
|
||||
if (debitCardList.value[0].length === 0) {
|
||||
proxy.$refs['uToast'].show({
|
||||
|
||||
Reference in New Issue
Block a user