fix: 新功能增加,原有bug修复。

This commit is contained in:
tianyongbao
2024-06-21 20:30:02 +08:00
parent 7ce6161b01
commit c8b5697264
36 changed files with 5178 additions and 516 deletions

View File

@@ -1,7 +1,7 @@
// 应用全局配置
const config = {
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
baseUrl: 'http://203.0.105.106:82/prod-api',
baseUrl: 'http://120.53.89.22:82/prod-api',
// baseUrl: 'http://localhost:8080',
//cloud后台网关地址
// baseUrl: 'http://192.168.10.3:8080',
@@ -12,7 +12,7 @@ const config = {
// 应用版本
version: "1.1.0",
// 应用logo
logo: "/static/logo.png",
logo: "/static/intc.jpg",
// 官方网站
site_url: "http://www.qdintc.com",
// 政策协议

View File

@@ -55,20 +55,6 @@
}
}
,
{
"path": "pages/work/base/pos/index",
"style": {
"navigationBarTitleText": "pos机管理"
}
}
,
{
"path": "pages/work/base/credit/index",
"style": {
"navigationBarTitleText": "信用卡管理"
}
}
,
{
"path": "pages/work/accounts/accountDealRecord/list",
"style": {
@@ -219,6 +205,66 @@
}
}
,
{
"path": "pages/work/base/debitCard/list",
"style": {
"navigationBarTitleText": "储蓄卡管理"
}
} ,
{
"path": "pages/work/base/debitCard/details",
"style": {
"navigationBarTitleText": "储蓄卡管理详情"
}
}
,
{
"path": "pages/work/base/debitCard/addEdit",
"style": {
"navigationBarTitleText": "储蓄卡管理"
}
}
,
{
"path": "pages/work/base/lend/list",
"style": {
"navigationBarTitleText": "借贷账户管理"
}
} ,
{
"path": "pages/work/base/lend/details",
"style": {
"navigationBarTitleText": "借贷账户管理详情"
}
}
,
{
"path": "pages/work/base/lend/addEdit",
"style": {
"navigationBarTitleText": "借贷账户管理"
}
}
,
{
"path": "pages/work/base/creditCard/list",
"style": {
"navigationBarTitleText": "信用卡管理"
}
} ,
{
"path": "pages/work/base/creditCard/details",
"style": {
"navigationBarTitleText": "信用卡管理详情"
}
}
,
{
"path": "pages/work/base/creditCard/addEdit",
"style": {
"navigationBarTitleText": "信用卡管理"
}
}
,
{
"path": "pages/work/bill/creditQueryRecord/list",
"style": {
@@ -263,6 +309,44 @@
"navigationBarTitleText": "信用卡账单"
}
},
{
"path": "pages/work/bill/futuresBill/list",
"style": {
"navigationBarTitleText": "期货账单"
}
} ,
{
"path": "pages/work/bill/futuresBill/details",
"style": {
"navigationBarTitleText": "期货账单明细"
}
}
,
{
"path": "pages/work/bill/futuresBill/addEdit",
"style": {
"navigationBarTitleText": "期货账单"
}
},
{
"path": "pages/work/bill/stocksBill/list",
"style": {
"navigationBarTitleText": "股票账单"
}
} ,
{
"path": "pages/work/bill/stocksBill/details",
"style": {
"navigationBarTitleText": "股票账单明细"
}
}
,
{
"path": "pages/work/bill/stocksBill/addEdit",
"style": {
"navigationBarTitleText": "股票账单"
}
},
{
"path": "pages/work/bill/onlineLendHistory/list",
"style": {
@@ -281,6 +365,20 @@
"style": {
"navigationBarTitleText": "网贷账单"
}
}
,
{
"path": "pages/work/bill/peopleLendHistory/list",
"style": {
"navigationBarTitleText": "人情账单"
}
}
,
{
"path": "pages/work/bill/peopleLendHistory/addEdit",
"style": {
"navigationBarTitleText": "人情账单"
}
},
{
"path": "pages/work/bill/onlineLendHistory/detailsAddEdit",

View File

@@ -93,14 +93,13 @@ const userStore = useUserStore()
const name = userStore.name;
const version = config.appInfo.version;
const avatar = ref(userStore.avatar);
const avatar = ref(window.location.protocol + '//' + window.location.hostname + ':' + window.location.port+userStore.avatar);
const windowHeight = ref(uni.getSystemInfoSync().windowHeight - 50);
const popup = ref(null);
uni.$on('refresh', () => {
avatar.value = userStore.avatar;
avatar.value = window.location.protocol + '//' + window.location.hostname + ':' + window.location.port+userStore.avatar;
})
function handleToInfo() {
uni.navigateTo({
url: '/pages_mine/pages/info/index'

View File

@@ -114,7 +114,7 @@ const data = reactive({
rules: {
typeName: [{ required: true, message: '记账类型不能为空', trigger:['change', 'blur'] }],
accountName: [{ required: true, message: '记账账户不能为空', trigger: ['change', 'blur'] }],
amount: [{type: 'string', required: true, message: '交易金额不能为空', trigger: ['change', 'blur'] }],
amount: [{type: 'float', required: true, message: '交易金额不能为空', trigger: ['change', 'blur'] }],
dealTypeName: [{ required: true, message: '交易类型不能为空', trigger:['change', 'blur'] }],
dealCategoryName: [{ required: true, message: '交易类别不能为空', trigger: ['change', 'blur'] }],
createTime: [{ required: true, message: '交易时间不能为空', trigger: ['change', 'blur'] }]

View File

@@ -2,9 +2,9 @@
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u--input v-model="queryParams.name" border="false" placeholder="请输入账户名称" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
<u-input v-model="queryParams.accountName" border="false" type="select" @click="handleAccount" placeholder="请选择记账账户" suffixIcon="search"
suffixIconStyle="color: #909399" class="search-input">
</u-input>
<u-icon :name="filterPanel ? 'arrow-up-fill' : 'arrow-down-fill'" color="#666666" size="28" label="筛选"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="filterPanel = !filterPanel"></u-icon>
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
@@ -120,6 +120,8 @@
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
<u-picker itemHeight="88" :show="showAccount" :columns="accountList" keyName="typeNameCodeAvailableLimit" @cancel="handleAccountCancel"
@confirm="handleAccountConfirm"></u-picker>
</view>
</template>
@@ -128,6 +130,7 @@ import {
listAccountDealRecord,
delAccountDealRecord,
} from '@/api/invest/accountDealRecord'
import { listAccounts } from '@/api/invest/accounts'
import { getDicts } from '@/api/system/dict/data.js'
import { timeHandler } from '@/utils/common.ts'
import {onLoad,onShow} from "@dcloudio/uni-app";
@@ -142,11 +145,18 @@ const dealTypeList = ref([])
const dealCategoryList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const showAccount = ref(false)
const accountList = ref([])
const timeShow= ref(false)
const flag= ref(true)
const time =ref( Number(new Date()))
const data = reactive({
filterPanel: false,
queryAccountParams: {
pageNum: 1,
state: '1',
pageSize: 100
},
queryParams: {
name: null,
type: null,
@@ -156,7 +166,7 @@ const data = reactive({
dealCategory: null
}
})
const { filterPanel, queryParams} = toRefs(data)
const { filterPanel, queryAccountParams, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
@@ -204,6 +214,9 @@ function getList() {
timeShow.value = false
}
function getDict() {
listAccounts(queryAccountParams.value).then((response) => {
accountList.value = [response.rows]
})
// 记账类型类型
getDicts('account_type').then(res => {
accountTypeList.value = res.data
@@ -234,6 +247,26 @@ function dictStr(val, arr) {
})
return str
}
function handleAccount() {
if (accountList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '记账账户为空 ', type: 'warning'
})
} else {
showAccount.value = true
}
}
function handleAccountConfirm(e) {
queryParams.value.accountName = e.value[0].typeNameCodeAvailableLimit
queryParams.value.accountId= e.value[0].id
showAccount.value = false
pageNum.value = 1
listData.value = []
getList()
}
function handleAccountCancel() {
showAccount.value = false
}
function selectAccountType(item) {
queryParams.value.type = item.dictValue
accountTypeList.value.map(ele => {
@@ -279,7 +312,8 @@ function selectAccountType(item) {
getList()
}
function resetQuery() {
queryParams.value.name = ''
queryParams.value.accountId = ''
queryParams.value.accountName = ''
queryParams.value.type = ''
queryParams.value.dealType = ''
queryParams.value.startTime = ''

View File

@@ -2,9 +2,9 @@
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u--input v-model="queryParams.name" border="false" placeholder="请输入名称" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
<u-input v-model="queryParams.accountName" border="false" type="select" @click="handleAccount" placeholder="请选择记账账户" suffixIcon="search"
suffixIconStyle="color: #909399" class="search-input">
</u-input>
<u-icon :name="filterPanel ? 'arrow-up-fill' : 'arrow-down-fill'" color="#666666" size="28" label="筛选"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="filterPanel = !filterPanel"></u-icon>
<!-- <u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
@@ -50,6 +50,8 @@
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
<u-picker itemHeight="88" :show="showAccount" :columns="accountList" keyName="typeNameCodeAvailableLimit" @cancel="handleAccountCancel"
@confirm="handleAccountConfirm"></u-picker>
</view>
</template>
@@ -66,17 +68,24 @@ const status = ref('loadmore')
const accountType = ref([])
const debitType = ref([])
const accountState= ref([])
const showAccount = ref(false)
const accountList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const data = reactive({
filterPanel: false,
queryAccountParams: {
pageNum: 1,
state: '1',
pageSize: 100
},
queryParams: {
name: null,
type: null,
state: null
}
})
const { filterPanel, queryParams} = toRefs(data)
const { filterPanel, queryAccountParams, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
@@ -112,6 +121,9 @@ function getList() {
})
}
function getDict() {
listAccounts(queryAccountParams.value).then((response) => {
accountList.value = [response.rows]
})
// 类型
getDicts('account_type').then(res => {
accountType.value = res.data
@@ -164,6 +176,26 @@ function selectType(item) {
Reflect.set(ele, 'selected', false)
}
})
}
function handleAccount() {
if (accountList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '记账账户为空 ', type: 'warning'
})
} else {
showAccount.value = true
}
}
function handleAccountConfirm(e) {
queryParams.value.accountName = e.value[0].typeNameCodeAvailableLimit
queryParams.value.accountId= e.value[0].id
showAccount.value = false
pageNum.value = 1
listData.value = []
getList()
}
function handleAccountCancel() {
showAccount.value = false
}
function searchSubmit() {
pageNum.value = 1
@@ -177,11 +209,16 @@ function selectType(item) {
getList()
}
function resetQuery() {
queryParams.value.name = '',
queryParams.value.accountId = ''
queryParams.value.accountName = ''
queryParams.value.state = '',
queryParams.value.type = ''
accountType.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
accountState.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
}
function enterDetails(item) {
uni.navigateTo({ url: `/pages/work/accounts/accounts/details?id=${item.id}` })

View File

@@ -2,9 +2,9 @@
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u--input v-model="queryParams.name" border="false" placeholder="请输入名称" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
<u-input v-model="queryParams.accountName" border="false" type="select" @click="handleAccount" placeholder="请选择记账账户" suffixIcon="search"
suffixIconStyle="color: #909399" class="search-input">
</u-input>
<u-icon :name="filterPanel ? 'arrow-up-fill' : 'arrow-down-fill'" color="#666666" size="28" label="筛选"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="filterPanel = !filterPanel"></u-icon>
<!-- <u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
@@ -93,6 +93,8 @@
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
<u-picker itemHeight="88" :show="showAccount" :columns="accountList" keyName="typeNameCodeAvailableLimit" @cancel="handleAccountCancel"
@confirm="handleAccountConfirm"></u-picker>
</view>
</template>
@@ -109,17 +111,24 @@ const status = ref('loadmore')
const accountType = ref([])
const debitType = ref([])
const accountState= ref([])
const showAccount = ref(false)
const accountList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const data = reactive({
filterPanel: false,
queryAccountParams: {
pageNum: 1,
state: '1',
pageSize: 100
},
queryParams: {
name: null,
type: null,
state: null
}
})
const { filterPanel, queryParams} = toRefs(data)
const { filterPanel, queryAccountParams, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
@@ -155,6 +164,9 @@ function getList() {
})
}
function getDict() {
listAccounts(queryAccountParams.value).then((response) => {
accountList.value = [response.rows]
})
// 类型
getDicts('account_type').then(res => {
accountType.value = res.data
@@ -213,6 +225,26 @@ function selectType(item) {
listData.value = []
getList()
filterPanel.value = false
}
function handleAccount() {
if (accountList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '记账账户为空 ', type: 'warning'
})
} else {
showAccount.value = true
}
}
function handleAccountConfirm(e) {
queryParams.value.accountName = e.value[0].typeNameCodeAvailableLimit
queryParams.value.accountId= e.value[0].id
showAccount.value = false
pageNum.value = 1
listData.value = []
getList()
}
function handleAccountCancel() {
showAccount.value = false
}
function searchBlur() {
pageNum.value = 1
@@ -220,6 +252,8 @@ function selectType(item) {
getList()
}
function resetQuery() {
queryParams.value.accountId = ''
queryParams.value.accountName = ''
queryParams.value.name = '',
queryParams.value.type = ''
accountType.value.map(ele => {

View File

@@ -2,9 +2,9 @@
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u--input v-model="queryParams.name" border="false" placeholder="请输入信用卡名称" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
<u-input v-model="queryParams.creditCardName" border="false" type="select" @click="handleCreditCard" placeholder="请选择信用卡" suffixIcon="search"
suffixIconStyle="color: #909399" class="search-input">
</u-input>
<u-icon :name="filterPanel ? 'arrow-up-fill' : 'arrow-down-fill'" color="#666666" size="28" label="筛选"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="filterPanel = !filterPanel"></u-icon>
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
@@ -103,6 +103,8 @@
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
<u-picker itemHeight="88" :show="showCreditCard" :columns="bankCardLendList" keyName="nameCode" @cancel="handleCreditCardCancel"
@confirm="handleCreditCardConfirm"></u-picker>
</view>
</template>
@@ -111,6 +113,7 @@ import {
listAccountsTransferRecord,
delAccountsTransferRecord,
} from '@/api/invest/accountsTransferRecord'
import { listAccounts } from '@/api/invest/accounts'
import { getDicts } from '@/api/system/dict/data.js'
import { timeHandler } from '@/utils/common.ts'
import {onLoad,onShow} from "@dcloudio/uni-app";
@@ -124,10 +127,18 @@ const dealTypeList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const timeShow= ref(false)
const showCreditCard = ref(false)
const bankCardLendList = ref([])
const flag= ref(true)
const time =ref( Number(new Date()))
const data = reactive({
filterPanel: false,
queryBankCardLendParams: {
pageNum: 1,
type: '2',
state: '1',
pageSize: 100
},
queryParams: {
name: null,
type: '2',
@@ -138,7 +149,7 @@ const data = reactive({
dealType: null
}
})
const { filterPanel, queryParams} = toRefs(data)
const { filterPanel, queryBankCardLendParams, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
@@ -186,6 +197,9 @@ function getList() {
timeShow.value = false
}
function getDict() {
listAccounts(queryBankCardLendParams.value).then((response) => {
bankCardLendList.value = [response.rows]
})
// 交易类型
getDicts('credit_repayment_type').then(res => {
dealTypeList.value = res.data
@@ -225,13 +239,29 @@ function dictStr(val, arr) {
getList()
filterPanel.value = false
}
function searchBlur() {
function handleCreditCard() {
if (bankCardLendList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '信用卡为空 ', type: 'warning'
})
} else {
showCreditCard.value = true
}
}
function handleCreditCardConfirm(e) {
queryParams.value.creditCardName = e.value[0].nameCode
queryParams.value.inAccountId= e.value[0].id
showCreditCard.value = false
pageNum.value = 1
listData.value = []
getList()
}
function handleCreditCardCancel() {
showCreditCard.value = false
}
function resetQuery() {
queryParams.value.name = ''
queryParams.value.creditCardName = ''
queryParams.value.inAccountId = ''
queryParams.value.type = '2'
queryParams.value.dealType = ''
queryParams.value.startTime = ''

View File

@@ -2,9 +2,9 @@
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u--input v-model="queryParams.name" border="false" placeholder="请输入储蓄账户名称" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
<u-input v-model="queryParams.accountName" border="false" type="select" @click="handleAccount" placeholder="请选择储蓄账户" suffixIcon="search"
suffixIconStyle="color: #909399" class="search-input">
</u-input>
<u-icon :name="filterPanel ? 'arrow-up-fill' : 'arrow-down-fill'" color="#666666" size="28" label="筛选"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="filterPanel = !filterPanel"></u-icon>
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
@@ -92,6 +92,8 @@
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
<u-picker itemHeight="88" :show="showAccount" :columns="accountList" keyName="typeNameCodeAvailableLimit" @cancel="handleAccountCancel"
@confirm="handleAccountConfirm"></u-picker>
</view>
</template>
@@ -100,6 +102,7 @@ import {
listAccountsTransferRecord,
delAccountsTransferRecord,
} from '@/api/invest/accountsTransferRecord'
import { listAccounts } from '@/api/invest/accounts'
import { getDicts } from '@/api/system/dict/data.js'
import { timeHandler } from '@/utils/common.ts'
import {onLoad,onShow} from "@dcloudio/uni-app";
@@ -112,11 +115,19 @@ const status = ref('loadmore')
const dealTypeList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const showAccount = ref(false)
const accountList = ref([])
const timeShow= ref(false)
const flag= ref(true)
const time =ref( Number(new Date()))
const data = reactive({
filterPanel: false,
queryAccountParams: {
pageNum: 1,
state: '1',
type: '1',
pageSize: 100
},
queryParams: {
name: null,
type: '4',
@@ -127,7 +138,7 @@ const data = reactive({
dealType: null
}
})
const { filterPanel, queryParams} = toRefs(data)
const { filterPanel, queryAccountParams, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
@@ -175,6 +186,9 @@ function getList() {
timeShow.value = false
}
function getDict() {
listAccounts(queryAccountParams.value).then((response) => {
accountList.value = [response.rows]
})
// 交易类型
getDicts('credit_repayment_type').then(res => {
dealTypeList.value = res.data
@@ -213,6 +227,26 @@ function dictStr(val, arr) {
listData.value = []
getList()
filterPanel.value = false
}
function handleAccount() {
if (accountList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '记账账户为空 ', type: 'warning'
})
} else {
showAccount.value = true
}
}
function handleAccountConfirm(e) {
queryParams.value.accountName = e.value[0].typeNameCodeAvailableLimit
queryParams.value.name = e.value[0].name
showAccount.value = false
pageNum.value = 1
listData.value = []
getList()
}
function handleAccountCancel() {
showAccount.value = false
}
function searchBlur() {
pageNum.value = 1
@@ -221,6 +255,7 @@ function dictStr(val, arr) {
}
function resetQuery() {
queryParams.value.name = ''
queryParams.value.accountName = ''
queryParams.value.type = ''
queryParams.value.dealType = ''
queryParams.value.startTime = ''

View File

@@ -2,9 +2,9 @@
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u--input v-model="queryParams.name" border="false" placeholder="请输入POS机或信用卡名称" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
<u-input v-model="queryParams.accountName" border="false" type="select" @click="handleAccount" placeholder="请选择POS机" suffixIcon="search"
suffixIconStyle="color: #909399" class="search-input">
</u-input>
<u-icon :name="filterPanel ? 'arrow-up-fill' : 'arrow-down-fill'" color="#666666" size="28" label="筛选"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="filterPanel = !filterPanel"></u-icon>
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
@@ -108,6 +108,8 @@
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
<u-picker itemHeight="88" :show="showAccount" :columns="accountList" keyName="nameCode" @cancel="handleAccountCancel"
@confirm="handleAccountConfirm"></u-picker>
</view>
</template>
@@ -116,6 +118,7 @@ import {
listAccountsTransferRecord,
delAccountsTransferRecord,
} from '@/api/invest/accountsTransferRecord'
import { listAccounts } from '@/api/invest/accounts'
import { getDicts } from '@/api/system/dict/data.js'
import { timeHandler } from '@/utils/common.ts'
import {onLoad,onShow} from "@dcloudio/uni-app";
@@ -128,10 +131,18 @@ const status = ref('loadmore')
const settingPickShow = ref(false)
const settingColumns = ref([])
const timeShow= ref(false)
const showAccount = ref(false)
const accountList = ref([])
const flag= ref(true)
const time =ref( Number(new Date()))
const data = reactive({
filterPanel: false,
queryAccountParams: {
pageNum: 1,
state: '1',
type: '6',
pageSize: 100
},
queryParams: {
name: null,
type: '1',
@@ -142,7 +153,7 @@ const data = reactive({
dealType: null
}
})
const { filterPanel, queryParams} = toRefs(data)
const { filterPanel, queryAccountParams, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
@@ -167,6 +178,9 @@ function loadmore() {
}
}
function getList() {
listAccounts(queryAccountParams.value).then((response) => {
accountList.value = [response.rows]
})
status.value = 'loading'
listAccountsTransferRecord({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => {
listData.value = listData.value.concat(res.rows)
@@ -201,6 +215,26 @@ function settingCancel() {
listData.value = []
getList()
filterPanel.value = false
}
function handleAccount() {
if (accountList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '记账账户为空 ', type: 'warning'
})
} else {
showAccount.value = true
}
}
function handleAccountConfirm(e) {
queryParams.value.accountName = e.value[0].nameCode
queryParams.value.posId= e.value[0].id
showAccount.value = false
pageNum.value = 1
listData.value = []
getList()
}
function handleAccountCancel() {
showAccount.value = false
}
function searchBlur() {
pageNum.value = 1
@@ -209,6 +243,7 @@ function settingCancel() {
}
function resetQuery() {
queryParams.value.name = ''
queryParams.value.posId = ''
queryParams.value.type = '1'
queryParams.value.dealType = ''
queryParams.value.startTime = ''

View File

@@ -1,208 +0,0 @@
<template>
<view class="normal-login-container">
<view class="logo-content align-center justify-center flex">
<image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
</image>
<text class="title">智聪科技记账平台登录</text>
</view>
<view class="login-form-content">
<view class="input-item flex align-center">
<view class="iconfont icon-user icon"></view>
<input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" />
</view>
<view class="input-item flex align-center">
<view class="iconfont icon-password icon"></view>
<input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
</view>
<view class="input-item flex align-center" style="width: 60%;margin: 0px;" v-if="captchaEnabled">
<view class="iconfont icon-code icon"></view>
<input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
<view class="login-code">
<image :src="codeUrl" @click="getCode" class="login-code-img"></image>
</view>
</view>
<view class="action-btn">
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
</view>
</view>
<view class="xieyi text-center">
<text class="text-grey1">登录即代表同意</text>
<text @click="handleUserAgrement" class="text-blue">用户协议</text>
<text @click="handlePrivacy" class="text-blue">隐私协议</text>
</view>
</view>
</template>
<script setup>
import modal from '@/plugins/modal'
import { getCodeImg } from '@/api/login'
import { ref } from "vue";
import config from '@/config.js'
import useUserStore from '@/store/modules/user'
import { getWxCode } from '@/utils/geek';
import { wxLogin } from '@/api/oauth';
import { setToken } from '@/utils/auth';
const userStore = useUserStore()
const codeUrl = ref("");
const captchaEnabled = ref(true); // 是否开启验证码
const useWxLogin = ref(false); // 是否使用微信登录
const globalConfig = ref(config);
const loginForm = ref({
username: "admin",
password: "admin123",
code: "",
uuid: ''
});
if (useWxLogin.value) {
getWxCode().then(res => {
console.log(res);
wxLogin('miniapp',res).then(res => {
if(res.token != null){
setToken(res.token);
loginSuccess()
}
});
})
}
// 获取图形验证码
function getCode() {
getCodeImg().then(res => {
captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled
if (captchaEnabled.value) {
codeUrl.value = 'data:image/gif;base64,' + res.img
loginForm.value.uuid = res.uuid
}
})
};
async function handleLogin() {
if (loginForm.value.username === "") {
modal.msgError("请输入您的账号")
} else if (loginForm.value.password === "") {
modal.msgError("请输入您的密码")
} else if (loginForm.value.code === "" && captchaEnabled.value) {
modal.msgError("请输入验证码")
} else {
modal.loading("登录中,请耐心等待...")
pwdLogin()
}
};
// 密码登录
async function pwdLogin() {
userStore.login(loginForm.value).then(() => {
modal.closeLoading()
loginSuccess()
}).catch(() => {
if (captchaEnabled.value) {
modal.closeLoading()
getCode()
}
})
};
function loginSuccess(result) {
// 设置用户信息
userStore.getInfo().then(res => {
uni.switchTab({
url: '/pages/index'
});
})
}
// 隐私协议
function handlePrivacy() {
let site = globalConfig.value.appInfo.agreements[0];
uni.navigateTo({
url: `/pages/common/webview/index?title=${site.title}&url=${site.url}`
});
};
// 用户协议
function handleUserAgrement() {
let site = globalConfig.value.appInfo.agreements[1]
uni.navigateTo({
url: `/pages/common/webview/index?title=${site.title}&url=${site.url}`
});
};
getCode();
</script>
<style lang="scss">
page {
background-color: #ffffff;
}
.normal-login-container {
width: 100%;
.logo-content {
width: 100%;
font-size: 21px;
text-align: center;
padding-top: 15%;
image {
border-radius: 4px;
}
.title {
margin-left: 10px;
}
}
.login-form-content {
text-align: center;
margin: 20px auto;
margin-top: 15%;
width: 80%;
.input-item {
margin: 20px auto;
background-color: #f5f6f7;
height: 45px;
border-radius: 20px;
.icon {
font-size: 38rpx;
margin-left: 10px;
color: #999;
}
.input {
width: 100%;
font-size: 14px;
line-height: 20px;
text-align: left;
padding-left: 15px;
}
}
.login-btn {
margin-top: 40px;
height: 45px;
}
.xieyi {
color: #333;
margin-top: 20px;
}
.login-code {
height: 38px;
float: right;
.login-code-img {
height: 38px;
position: absolute;
margin-left: 10px;
width: 200rpx;
}
}
}
}
</style>

View File

@@ -0,0 +1,288 @@
<template>
<view class="container" style="paddingBottom:1rpx;">
<u-navbar
leftIconSize="40rpx"
leftIconColor="#333333"
title="信用卡管理"
>
</u-navbar>
<view class="section">
<view class="section-title">{{ title}}</view>
<view class="form-view">
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="auto"
:labelStyle="{ color: '#333333', fontSize: '30rpx' }">
<u-form-item label="信用卡名称" prop="name" required >
<u--input v-model="form.name" placeholder="请填写信用卡名称"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="信用卡卡号" prop="code" required >
<u--input v-model="form.code" placeholder="请填写信用卡卡号"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="信用卡额度" required prop="creditLimit" >
<u--input v-model="form.creditLimit" placeholder="请填写信用卡额度"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="账单日" required prop="billDate" >
<u--input v-model="form.billDate" placeholder="请填写账单日"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="还款日" required prop="payDate" >
<u--input v-model="form.payDate" placeholder="请填写还款日"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="信用卡安全码" prop="cvv" >
<u--input v-model="form.cvv" placeholder="请填写信用卡安全码"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="开户行" prop="openingBank" >
<u--input v-model="form.openingBank" placeholder="请填写开户行"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="开户日期" prop="activationDate" @click="selectDate(1)">
<u--input v-model="form.activationDate" disabled disabledColor="#ffffff" placeholder="请选择开户日期" inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="宽限期" prop="delayPeriod" >
<u--input v-model="form.delayPeriod" placeholder="请填写宽限期"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="有效期" prop="effectiveDate" @click="selectDate(2)">
<u--input v-model="form.effectiveDate" disabled disabledColor="#ffffff" placeholder="请选择有效期" inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="账单日消费" prop="isNextBillDateName" @click="handleShowIsNextBillDate">
<u--input v-model="form.isNextBillDateName" 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="nextBillDateTime" >
<u--input v-model="form.nextBillDateTime" placeholder="请填写账单日时间"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="0账单操作" prop="isZeroBillName" @click="handleShowIsZeroBill">
<u--input v-model="form.isZeroBillName" disabled disabledColor="#ffffff" placeholder="请选择0账单操作"
inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-down"></u-icon>
</u-form-item>
<u-form-item label="备注" prop="remark" labelPosition="top">
<u--textarea v-model="form.remark" placeholder="请填写备注" border="none" autoHeight inputAlign="right" count
maxlength="20000" style="padding:18rpx 0;"></u--textarea>
</u-form-item>
</u--form>
<view class="form-btn">
<u-button type="primary" text="提交" @click="submit"></u-button>
</view>
</view>
</view>
<u-toast ref="uToast"></u-toast>
<u-picker itemHeight="88" :show="showIsNextBillDate" :columns="isNextBillDateList" keyName="dictLabel" @cancel="handleCancel"
@confirm="handleConfirm"></u-picker>
<u-picker itemHeight="88" :show="showIsZeroBill" :columns="isZeroBillList" keyName="dictLabel" @cancel="handleIsZeroBillCancel"
@confirm="handleIsZeroBillConfirm"></u-picker>
<u-datetime-picker
:show="datePickShow"
mode="date"
ref="createTimeRef"
@cancel="datePickShow=false"
@confirm="datePickConfirm"
itemHeight="88"
></u-datetime-picker>
</view>
</template>
<script setup>
import { getBankcardLend, addBankcardLend, updateBankcardLend } from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
const { proxy } = getCurrentInstance()
import dayjs from 'dayjs'
import {onLoad,onReady} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed ,getCurrentInstance }from "vue";
const datePickShow = ref(false)
const showIsNextBillDate = ref(false)
const showIsZeroBill = ref(false)
const title = ref("信用卡管理")
const isNextBillDateList = ref([])
const isZeroBillList = ref([])
const dateType = ref(1)
const data = reactive({
form: {
id: null,
name: null,
type: '2',
code: null,
openingBank: null,
activationDate: null,
billDate: null,
payDate: null,
delayPeriod: null,
creditLimit: null,
effectiveDate: null,
cvv: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null,
remark: null,
debitType: null,
isNextBillDate: null,
nextBillDateTime: null,
isZeroBill: null
},
// dateType:'1',
rules: {
name: [{ type: 'string', required: true, message: '信用卡名称不能为空', trigger: ['change', 'blur'] }],
code: [{ type: 'string', required: true, message: '信用卡卡号不能为空', trigger: ['change', 'blur'] }],
billDate: [{ type: 'int', required: true, message: '账单日不能为空', trigger: ['change', 'blur'] }],
payDate: [{ type: 'int', required: true, message: '还款日不能为空', trigger: ['change', 'blur'] }],
creditLimit: [{ type: 'int', required: true, message: '信用卡额度不能为空', trigger: ['change', 'blur'] }],
}
})
const { form, rules} = toRefs(data)
onLoad((option) => {
form.value.id = option.id
if(form.value.id!=null){
title.value="信用卡管理-修改"
}else{
title.value="信用卡管理-新增"
}
getDict()
})
onReady(() => {
form.value.activationDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
form.value.effectiveDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
})
function getDict() {
// 类型
getDicts('is_next_bill_date').then(res => {
isNextBillDateList.value =[res.data]
})
// 类型
getDicts('is_zero_bill').then(res => {
isZeroBillList.value =[res.data]
})
if(form.value.id!=null){
getBankcardLend(form.value.id).then(res => {
form.value = res.data
// 类型
getDicts('is_next_bill_date').then(result => {
form.value.isNextBillDateName=dictStr(form.value.isNextBillDate, result.data)
})
// 类型
getDicts('is_zero_bill').then(result => {
form.value.isZeroBillName=dictStr(form.value.isZeroBill, result.data)
})
})
}
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function handleShowIsNextBillDate() {
if (isNextBillDateList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '账单日消费为空 ', type: 'warning'
})
} else {
showIsNextBillDate.value = true
}
}
function handleConfirm(e) {
form.value.isNextBillDateName = e.value[0].dictLabel
form.value.isNextBillDate = e.value[0].dictValue
showIsNextBillDate.value = false
}
function handleCancel() {
showIsNextBillDate.value = false
}
function handleShowIsZeroBill() {
if (isZeroBillList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '0账单操作为空 ', type: 'warning'
})
} else {
showIsZeroBill.value = true
}
}
function handleIsZeroBillConfirm(e) {
form.value.isZeroBillName = e.value[0].dictLabel
form.value.isZeroBill = e.value[0].dictValue
showIsZeroBill.value = false
}
function handleIsZeroBillCancel() {
showIsZeroBill.value = false
}
function selectDate(type) {
dateType.value=type
datePickShow.value = true
proxy.$refs['createTimeRef'].innerValue = new Date().getTime()
}
function datePickConfirm(e) {
if(dateType.value===1){
form.value.activationDate = dayjs(e.value).format("YYYY-MM-DD")
}
if(dateType.value===2){
form.value.effectiveDate = dayjs(e.value).format("YYYY-MM-DD")
}
datePickShow.value = false
}
function submit() {
proxy.$refs['uForm'].validate().then(() => {
if (form.value.id != null) {
updateBankcardLend(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '修改成功', complete() {
uni.navigateTo({ url: `/pages/work/base/creditCard/list` })
}
})
})
}else {
addBankcardLend(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '新增成功', complete() {
uni.navigateTo({ url: `/pages/work/base/creditCard/list` })
}
})
})
}
})
}
</script>
<style lang="scss" scoped>
.section {
margin: 24rpx;
padding: 16rpx 24rpx;
background-color: #fff;
border-radius: 8rpx;
.section-title {
width: 360rpx;
color: #333333;
line-height: 44rpx;
font-size: 30rpx;
border-left: 6rpx solid #2681FF;
padding-left: 26rpx;
}
.form-view {
padding: 20rpx 0rpx 0 10rpx;
.form-btn {
padding-top: 20rpx;
}
}
}
</style>

View File

@@ -0,0 +1,104 @@
<template>
<view class="container" style="paddingBottom:1rpx;">
<u-navbar
leftIconSize="40rpx"
leftIconColor="#333333"
title="信用卡详情"
>
</u-navbar>
<view class="section">
<u-cell-group>
<u-cell title="信用卡名称:" titleStyle="font-weight:bolder" :value="detailInfo.name"></u-cell>
<u-cell title="信用卡卡号:" titleStyle="font-weight:bolder" :value="detailInfo.code"></u-cell>
<u-cell title="信用卡额度:" titleStyle="font-weight:bolder" :value="detailInfo.creditLimit"></u-cell>
<u-cell title="开户日期:" titleStyle="font-weight:bolder" center :value="detailInfo.activationDate"> </u-cell>
<u-cell title="开户行:" titleStyle="font-weight:bolder" :value="detailInfo.openingBank"></u-cell>
<u-cell title="有效期:" titleStyle="font-weight:bolder" :value="detailInfo.effectiveDate"></u-cell>
<u-cell title="账单日:" titleStyle="font-weight:bolder" :value="detailInfo.billDateName"></u-cell>
<u-cell title="还款日:" titleStyle="font-weight:bolder" :value="detailInfo.payDateName"></u-cell>
<u-cell title="账单日消费:" titleStyle="font-weight:bolder" :value="detailInfo.isNextBillDate"></u-cell>
<u-cell title="0账单操作:" titleStyle="font-weight:bolder" :value="detailInfo.isZeroBill"></u-cell>
<u-cell title="延缓期限:" titleStyle="font-weight:bolder" :value="detailInfo.delayPeriod"></u-cell>
<u-cell title="备注:" titleStyle="font-weight:bolder" center :value="detailInfo.remark"> </u-cell>
</u-cell-group>
</view>
<u-toast ref="uToast"></u-toast>
</view>
</template>
<script setup>
import { getBankcardLend} from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
import {onLoad} from "@dcloudio/uni-app";
import {reactive ,toRefs,ref,computed }from "vue";
const id = ref('')
const data = reactive({
detailInfo: {}
})
const {detailInfo} = toRefs(data)
onLoad((option) => {
id.value = option.id
getInfo()
})
function getInfo() {
getBankcardLend(id.value).then(res => {
detailInfo.value = res.data
// 类型
getDicts('is_next_bill_date').then(result => {
detailInfo.value.isNextBillDate=dictStr(detailInfo.value.isNextBillDate, result.data)
})
// 类型
getDicts('is_zero_bill').then(result => {
detailInfo.value.isZeroBill=dictStr(detailInfo.value.isZeroBill, result.data)
})
})
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
</script>
<style lang="scss" scoped>
.section {
margin: 24rpx;
padding: 16rpx 24rpx;
background-color: #fff;
border-radius: 8rpx;
.section-title {
width: 280rpx;
color: #333333;
line-height: 44rpx;
font-size: 30rpx;
border-left: 6rpx solid #2681FF;
padding-left: 26rpx;
}
.content {
width: 647rpx;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
text-align: left;
}
.img-con {
display: flex;
flex-wrap: wrap;
gap: 20rpx
}
.form-view {
padding: 20rpx 0rpx 0 10rpx;
.form-btn {
padding-top: 20rpx;
}
}
}
</style>

View File

@@ -0,0 +1,363 @@
<template>
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u--input v-model="queryParams.name" border="false" placeholder="请输入信用卡名称" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="handleAdd()"></u-icon>
</view>
</u-sticky>
<u-list @scrolltolower="loadmore" :spaceHeight="116" lowerThreshold="100">
<u-list-item v-for="(item, index) in listData" :key="index">
<view class="list-item">
<view class="item-header" @click="enterDetails(item)">
<u--text suffixIcon="arrow-right" lines="1" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
:text="item.name+'-'+item.code " size="30rpx" color="#333333" :bold="true"></u--text>
</view>
<view class="item-row">
<text class="row-label">信用卡额度</text>
<text class="row-value">{{ item.creditLimit }}</text>
</view>
<view class="item-row">
<text class="row-label">账单日</text>
<text class="row-value">{{ item.billDateName }}</text>
</view>
<view class="item-row">
<text class="row-label">还款日</text>
<text class="row-value">{{ item.payDateName }}</text>
</view>
<view class="item-row">
<text class="row-label">延缓期限</text>
<text class="row-value">{{ item.delayPeriod }}</text>
</view>
<view class="item-row">
<text class="row-label">开户日期</text>
<text class="row-value">{{ item.activationDate }}</text>
</view>
<view class="item-row">
<text class="row-label">有效期</text>
<text class="row-value">{{ item.effectiveDate }}</text>
</view>
<view class="item-row">
<text class="row-label">账单日消费</text>
<text class="row-value">{{ dictStr(item.isNextBillDate, isNextBillDateList) }}</text>
</view>
<view class="item-row">
<text class="row-label">0账单操作</text>
<text class="row-value">{{ dictStr(item.isZeroBill, isZeroBillList) }}</text>
</view>
<view class="operate" >
<!-- <view class="btn filling" @click="enterDetails(item)">查看</view > -->
<view class="btn filling" @click="handleEdit(item)">修改</view>
<view class="btn filling" @click="handleDelete(item)">删除</view>
</view>
</view>
</u-list-item>
<view>
</view>
<u-loadmore :status="status" loadingIcon="semicircle" height="88" fontSize="32rpx" @loadmore="loadmore" />
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
</view>
</template>
<script setup>
import { listBankcardLend,delBankcardLend} from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
import {onLoad,onShow} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed }from "vue";
const pageNum = ref(1)
const listData = ref([])
const isShow = ref(false)
const status = ref('loadmore')
const isNextBillDateList = ref([])
const isZeroBillList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const data = reactive({
filterPanel: false,
queryParams: {
name: null,
type: '2'
}
})
const { filterPanel, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
onLoad(() => {
getDict()
getList()
});
onShow(() => {
if (isShow.value) {
getList()
isShow.value = false
}
});
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {
getList()
}
}
function getList() {
status.value = 'loading'
listBankcardLend({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => {
listData.value = listData.value.concat(res.rows)
if (listData.value.length < res.total) {
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
status.value = 'nomore'
})
}
function getDict() {
// 类型
getDicts('is_next_bill_date').then(res => {
isNextBillDateList.value = res.data
})
// 类型
getDicts('is_zero_bill').then(res => {
isZeroBillList.value = res.data
})
}
function settingConfirm(e) {
queryParams.value.settingId = e.value[0].settingId
queryParams.value.settingName = e.value[0].settingName
settingPickShow.value = false
}
function settingCancel() {
settingPickShow.value = false
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function searchBlur() {
pageNum.value = 1
listData.value = []
getList()
}
function resetQuery() {
queryParams.value.name = '',
queryParams.value.type = '2'
isNextBillDateList.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
}
function enterDetails(item) {
uni.navigateTo({ url: `/pages/work/base/creditCard/details?id=${item.id}` })
}
function handleEdit(item) {
uni.navigateTo({ url: `/pages/work/base/creditCard/addEdit?id=${item.id}` })
isShow.value = true
}
function handleAdd() {
uni.navigateTo({ url: `/pages/work/base/creditCard/addEdit` })
isShow.value = true
}
function handleDelete(item) {
uni.showModal({
title: '提示',
content: '你确定要删除吗',
success: function (res) {
if (res.confirm) {
delBankcardLend(item.id)
uni.navigateTo({ url: `/pages/work/base/creditCard/list` })
} else if (res.cancel) {
console.log('取消');
}
}
});
}
</script>
<style lang="scss" scoped>
.btnAdd {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
display:float;
text-align: center;
}
.search-view {
padding: 12rpx 32rpx;
background-color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
margin-bottom: 24rpx;
.search-input {
background: #F5F5F5;
color: #333333;
margin-right: 36rpx;
}
.filter-panel {
width: 100%;
position: absolute;
left: 0;
top: 96rpx;
background-color: rgba(0, 0, 0, 0.5);
.filter-panel-content {
background-color: #ffff;
padding: 0 30rpx 30rpx;
.filter-title {
color: #000000;
font-size: 30rpx;
font-weight: 500;
padding: 30rpx 0;
}
.state-list {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.state-item {
width: 210rpx;
height: 72rpx;
border: 1rpx solid rgba(0, 0, 0, 0.25);
border-radius: 72rpx;
text-align: center;
line-height: 72rpx;
margin: 0 20rpx 20rpx 0;
font-size: 28rpx;
color: #000000;
}
.active {
background-color: rgba(222, 241, 255, 1);
border: 1rpx solid rgba(22, 119, 255, 1);
}
}
}
.btn-box {
display: flex;
padding: 24rpx 30rpx;
background-color: #fff;
box-shadow: 0rpx -10rpx 20rpx #EEEEEE;
}
}
}
.list-item {
margin: 0 24rpx 24rpx;
padding: 32rpx;
background-color: #fff;
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 16rpx;
.status {
.status-item {
width: 120rpx;
height: 44rpx;
text-align: center;
line-height: 44rpx;
border-radius: 4rpx;
font-size: 24rpx;
}
.status1 {
background: #F0F0F0;
color: #8C8C8C;
}
.status2 {
background: rgba(38, 129, 255, 0.2);
color: #2681FF;
}
.status3 {
background: #F7F7F7;
color: #2681FF;
}
.status4 {
background: rgba(255, 85, 51, 0.2);
color: #FF5533;
}
.status5 {
background: #F7F7F7;
color: rgba(0, 0, 0, 0.85);
}
.status7 {
background: rgba(255, 129, 51, 0.2);
color: #FF8133;
}
.status8 {
background: rgba(65, 217, 165, 0.2);
color: #41D9A5;
}
}
}
.item-row {
padding: 16rpx 0;
.row-label {
color: rgba(0, 0, 0, 0.55);
}
.row-value {
color: rgba(0, 0, 0, 0.85)
}
}
.operate {
display: flex;
justify-content: flex-end;
.btn {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
margin-left: 5rpx;
text-align: center;
}
.circulation {
background: rgba(0, 0, 0, 0.04);
margin-right: 24rpx;
color: rgba(0, 0, 0, 0.85);
}
.filling {
background: #2681FF;
border-radius: 8rpx;
color: #FFFFFF;
}
}
}
</style>

View File

@@ -0,0 +1,224 @@
<template>
<view class="container" style="paddingBottom:1rpx;">
<u-navbar
leftIconSize="40rpx"
leftIconColor="#333333"
title="储蓄卡管理"
>
</u-navbar>
<view class="section">
<view class="section-title">{{ title}}</view>
<view class="form-view">
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="auto"
:labelStyle="{ color: '#333333', fontSize: '30rpx' }">
<u-form-item label="储蓄卡名称" prop="name" required >
<u--input v-model="form.name" placeholder="请填写储蓄卡名称"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="储蓄卡卡号" prop="code" required >
<u--input v-model="form.code" placeholder="请填写储蓄卡卡号"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="储蓄卡类型" prop="debitTypeName" required @click="handleShowTeam">
<u--input v-model="form.debitTypeName" 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="openingBank" >
<u--input v-model="form.openingBank" placeholder="请填写开户行"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="开户日期" prop="activationDate" @click="selectDate(1)">
<u--input v-model="form.activationDate" disabled disabledColor="#ffffff" placeholder="请选择开户日期" inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="有效期" prop="effectiveDate" @click="selectDate(2)">
<u--input v-model="form.effectiveDate" disabled disabledColor="#ffffff" placeholder="请选择有效期" inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="备注" prop="remark" labelPosition="top">
<u--textarea v-model="form.remark" placeholder="请填写备注" border="none" autoHeight inputAlign="right" count
maxlength="20000" style="padding:18rpx 0;"></u--textarea>
</u-form-item>
</u--form>
<view class="form-btn">
<u-button type="primary" text="提交" @click="submit"></u-button>
</view>
</view>
</view>
<u-toast ref="uToast"></u-toast>
<u-picker itemHeight="88" :show="showTeam" :columns="debitTypeList" keyName="dictLabel" @cancel="handleCancel"
@confirm="handleConfirm"></u-picker>
<u-datetime-picker
:show="datePickShow"
mode="date"
ref="createTimeRef"
@cancel="datePickShow=false"
@confirm="datePickConfirm"
itemHeight="88"
></u-datetime-picker>
</view>
</template>
<script setup>
import { getBankcardLend, addBankcardLend, updateBankcardLend } from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
const { proxy } = getCurrentInstance()
import dayjs from 'dayjs'
import {onLoad,onReady} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed ,getCurrentInstance }from "vue";
const datePickShow = ref(false)
const showTeam = ref(false)
const title = ref("储蓄卡管理")
const debitTypeList = ref([])
const dateType = ref(1)
const data = reactive({
form: {
id: null,
name: null,
type: '1',
code: null,
openingBank: null,
activationDate: null,
billDate: null,
payDate: null,
delayPeriod: null,
creditLimit: null,
effectiveDate: null,
cvv: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null,
remark: null,
debitType: null
},
// dateType:'1',
rules: {
name: [{ type: 'string', required: true, message: '储蓄卡名称不能为空', trigger: ['change', 'blur'] }],
code: [{ type: 'string', required: true, message: '储蓄卡卡号不能为空', trigger: ['change', 'blur'] }],
debitTypeName: [{ type: 'string', required: true, message: '储蓄卡类型不能为空', trigger: ['change', 'blur'] }],
}
})
const { form, rules} = toRefs(data)
onLoad((option) => {
form.value.id = option.id
if(form.value.id!=null){
title.value="储蓄卡管理-修改"
}else{
title.value="储蓄卡管理-新增"
}
getDict()
})
onReady(() => {
form.value.activationDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
form.value.effectiveDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
})
function getDict() {
// 类型
getDicts('debit_type').then(res => {
debitTypeList.value =[res.data]
})
if(form.value.id!=null){
getBankcardLend(form.value.id).then(res => {
form.value = res.data
// 类型
getDicts('debit_type').then(result => {
form.value.debitTypeName=dictStr(form.value.debitType, result.data)
})
})
}
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function handleShowTeam() {
if (debitTypeList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '类型为空 ', type: 'warning'
})
} else {
showTeam.value = true
}
}
function handleConfirm(e) {
form.value.debitTypeName = e.value[0].dictLabel
form.value.debitType = e.value[0].dictValue
showTeam.value = false
}
function handleCancel() {
showTeam.value = false
}
function selectDate(type) {
dateType.value=type
datePickShow.value = true
proxy.$refs['createTimeRef'].innerValue = new Date().getTime()
}
function datePickConfirm(e) {
if(dateType.value===1){
form.value.activationDate = dayjs(e.value).format("YYYY-MM-DD")
}
if(dateType.value===2){
form.value.effectiveDate = dayjs(e.value).format("YYYY-MM-DD")
}
datePickShow.value = false
}
function submit() {
proxy.$refs['uForm'].validate().then(() => {
if (form.value.id != null) {
updateBankcardLend(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '修改成功', complete() {
uni.navigateTo({ url: `/pages/work/base/debitCard/list` })
}
})
})
}else {
addBankcardLend(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '新增成功', complete() {
uni.navigateTo({ url: `/pages/work/base/debitCard/list` })
}
})
})
}
})
}
</script>
<style lang="scss" scoped>
.section {
margin: 24rpx;
padding: 16rpx 24rpx;
background-color: #fff;
border-radius: 8rpx;
.section-title {
width: 360rpx;
color: #333333;
line-height: 44rpx;
font-size: 30rpx;
border-left: 6rpx solid #2681FF;
padding-left: 26rpx;
}
.form-view {
padding: 20rpx 0rpx 0 10rpx;
.form-btn {
padding-top: 20rpx;
}
}
}
</style>

View File

@@ -0,0 +1,94 @@
<template>
<view class="container" style="paddingBottom:1rpx;">
<u-navbar
leftIconSize="40rpx"
leftIconColor="#333333"
title="储蓄卡详情"
>
</u-navbar>
<view class="section">
<u-cell-group>
<u-cell title="储蓄卡名称:" titleStyle="font-weight:bolder" :value="detailInfo.name"></u-cell>
<u-cell title="储蓄卡卡号:" titleStyle="font-weight:bolder" :value="detailInfo.code"></u-cell>
<u-cell title="储蓄卡类型:" titleStyle="font-weight:bolder" :value="detailInfo.debitType"></u-cell>
<u-cell title="开户行:" titleStyle="font-weight:bolder" :value="detailInfo.openingBank"></u-cell>
<u-cell title="开户日期:" titleStyle="font-weight:bolder" center :value="detailInfo.activationDate"> </u-cell>
<u-cell title="备注:" titleStyle="font-weight:bolder" center :value="detailInfo.remark"> </u-cell>
</u-cell-group>
</view>
<u-toast ref="uToast"></u-toast>
</view>
</template>
<script setup>
import { getBankcardLend} from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
import {onLoad} from "@dcloudio/uni-app";
import {reactive ,toRefs,ref,computed }from "vue";
const id = ref('')
const data = reactive({
detailInfo: {}
})
const {detailInfo} = toRefs(data)
onLoad((option) => {
id.value = option.id
getInfo()
})
function getInfo() {
getBankcardLend(id.value).then(res => {
detailInfo.value = res.data
// 类型
getDicts('debit_type').then(result => {
detailInfo.value.debitType=dictStr(detailInfo.value.debitType, result.data)
})
})
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
</script>
<style lang="scss" scoped>
.section {
margin: 24rpx;
padding: 16rpx 24rpx;
background-color: #fff;
border-radius: 8rpx;
.section-title {
width: 280rpx;
color: #333333;
line-height: 44rpx;
font-size: 30rpx;
border-left: 6rpx solid #2681FF;
padding-left: 26rpx;
}
.content {
width: 647rpx;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
text-align: left;
}
.img-con {
display: flex;
flex-wrap: wrap;
gap: 20rpx
}
.form-view {
padding: 20rpx 0rpx 0 10rpx;
.form-btn {
padding-top: 20rpx;
}
}
}
</style>

View File

@@ -0,0 +1,381 @@
<template>
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u--input v-model="queryParams.name" border="false" placeholder="请输入储蓄卡名称" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
<u-icon :name="filterPanel ? 'arrow-up-fill' : 'arrow-down-fill'" color="#666666" size="28" label="筛选"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="filterPanel = !filterPanel"></u-icon>
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="handleAdd()"></u-icon>
<u-transition :show="filterPanel" mode="fade">
<view class="filter-panel" :style="{ height: `${windowHeight - 42}px` }">
<view class="filter-panel-content">
<view class="filter-title">储蓄卡类型</view>
<view class="state-list">
<view v-for="item in debitTypeList" :key="item.id" class="state-item"
:class="item.selected ? 'active' : ''" @click="selectStatus(item)">{{ item.dictLabel }}</view>
</view>
</view>
<view class="btn-box">
<u-button text="重置" style="margin-right:20rpx" @click="resetQuery()"></u-button>
<u-button type="primary" text="确定" @click="searchSubmit()"></u-button>
</view>
</view>
</u-transition>
</view>
</u-sticky>
<u-list @scrolltolower="loadmore" :spaceHeight="116" lowerThreshold="100">
<u-list-item v-for="(item, index) in listData" :key="index">
<view class="list-item">
<view class="item-header" @click="enterDetails(item)">
<u--text suffixIcon="arrow-right" lines="1" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
:text="item.name+'-'+item.code " size="30rpx" color="#333333" :bold="true"></u--text>
</view>
<view class="item-row">
<text class="row-label">储蓄卡类型</text>
<text class="row-value">{{ dictStr(item.debitType, debitTypeList) }}</text>
</view>
<!-- <view class="item-row">
<text class="row-label">储蓄卡卡号</text>
<text class="row-value">{{ item.code }}</text>
</view> -->
<view class="item-row">
<text class="row-label">开户行</text>
<text class="row-value">{{ item.openingBank }}</text>
</view>
<view class="item-row">
<text class="row-label">开户日期</text>
<text class="row-value">{{ item.activationDate }}</text>
</view>
<view class="item-row">
<text class="row-label">有效期</text>
<text class="row-value">{{ item.effectiveDate }}</text>
</view>
<view class="operate" >
<!-- <view class="btn filling" @click="enterDetails(item)">查看</view > -->
<view class="btn filling" @click="handleEdit(item)">修改</view>
<view class="btn filling" @click="handleDelete(item)">删除</view>
</view>
</view>
</u-list-item>
<view>
</view>
<u-loadmore :status="status" loadingIcon="semicircle" height="88" fontSize="32rpx" @loadmore="loadmore" />
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
</view>
</template>
<script setup>
import { listBankcardLend,delBankcardLend} from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
import {onLoad,onShow} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed }from "vue";
const pageNum = ref(1)
const listData = ref([])
const isShow = ref(false)
const status = ref('loadmore')
const debitTypeList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const data = reactive({
filterPanel: false,
queryParams: {
name: null,
type: '1',
debitType: ''
}
})
const { filterPanel, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
onLoad(() => {
getDict()
getList()
});
onShow(() => {
if (isShow.value) {
getList()
isShow.value = false
}
});
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {
getList()
}
}
function getList() {
status.value = 'loading'
listBankcardLend({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => {
listData.value = listData.value.concat(res.rows)
if (listData.value.length < res.total) {
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
status.value = 'nomore'
})
}
function getDict() {
// 类型
getDicts('debit_type').then(res => {
debitTypeList.value = res.data
})
}
function settingConfirm(e) {
queryParams.value.settingId = e.value[0].settingId
queryParams.value.settingName = e.value[0].settingName
settingPickShow.value = false
}
function settingCancel() {
settingPickShow.value = false
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function selectStatus(item) {
queryParams.value.debitType = item.dictValue
debitTypeList.value.map(ele => {
if (ele.dictValue == item.dictValue) {
ele.selected = true
Reflect.set(ele, 'selected', true)
} else {
Reflect.set(ele, 'selected', false)
}
})
}
function searchSubmit() {
pageNum.value = 1
listData.value = []
getList()
filterPanel.value = false
}
function searchBlur() {
pageNum.value = 1
listData.value = []
getList()
}
function resetQuery() {
queryParams.value.name = '',
queryParams.value.debitType = '',
queryParams.value.type = '1'
debitTypeList.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
}
function enterDetails(item) {
uni.navigateTo({ url: `/pages/work/base/debitCard/details?id=${item.id}` })
}
function handleEdit(item) {
uni.navigateTo({ url: `/pages/work/base/debitCard/addEdit?id=${item.id}` })
isShow.value = true
}
function handleAdd() {
uni.navigateTo({ url: `/pages/work/base/debitCard/addEdit` })
isShow.value = true
}
function handleDelete(item) {
uni.showModal({
title: '提示',
content: '你确定要删除吗',
success: function (res) {
if (res.confirm) {
delBankcardLend(item.id)
uni.navigateTo({ url: `/pages/work/base/debitCard/list` })
} else if (res.cancel) {
console.log('取消');
}
}
});
}
</script>
<style lang="scss" scoped>
.btnAdd {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
display:float;
text-align: center;
}
.search-view {
padding: 12rpx 32rpx;
background-color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
margin-bottom: 24rpx;
.search-input {
background: #F5F5F5;
color: #333333;
margin-right: 36rpx;
}
.filter-panel {
width: 100%;
position: absolute;
left: 0;
top: 96rpx;
background-color: rgba(0, 0, 0, 0.5);
.filter-panel-content {
background-color: #ffff;
padding: 0 30rpx 30rpx;
.filter-title {
color: #000000;
font-size: 30rpx;
font-weight: 500;
padding: 30rpx 0;
}
.state-list {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.state-item {
width: 210rpx;
height: 72rpx;
border: 1rpx solid rgba(0, 0, 0, 0.25);
border-radius: 72rpx;
text-align: center;
line-height: 72rpx;
margin: 0 20rpx 20rpx 0;
font-size: 28rpx;
color: #000000;
}
.active {
background-color: rgba(222, 241, 255, 1);
border: 1rpx solid rgba(22, 119, 255, 1);
}
}
}
.btn-box {
display: flex;
padding: 24rpx 30rpx;
background-color: #fff;
box-shadow: 0rpx -10rpx 20rpx #EEEEEE;
}
}
}
.list-item {
margin: 0 24rpx 24rpx;
padding: 32rpx;
background-color: #fff;
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 16rpx;
.status {
.status-item {
width: 120rpx;
height: 44rpx;
text-align: center;
line-height: 44rpx;
border-radius: 4rpx;
font-size: 24rpx;
}
.status1 {
background: #F0F0F0;
color: #8C8C8C;
}
.status2 {
background: rgba(38, 129, 255, 0.2);
color: #2681FF;
}
.status3 {
background: #F7F7F7;
color: #2681FF;
}
.status4 {
background: rgba(255, 85, 51, 0.2);
color: #FF5533;
}
.status5 {
background: #F7F7F7;
color: rgba(0, 0, 0, 0.85);
}
.status7 {
background: rgba(255, 129, 51, 0.2);
color: #FF8133;
}
.status8 {
background: rgba(65, 217, 165, 0.2);
color: #41D9A5;
}
}
}
.item-row {
padding: 16rpx 0;
.row-label {
color: rgba(0, 0, 0, 0.55);
}
.row-value {
color: rgba(0, 0, 0, 0.85)
}
}
.operate {
display: flex;
justify-content: flex-end;
.btn {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
margin-left: 5rpx;
text-align: center;
}
.circulation {
background: rgba(0, 0, 0, 0.04);
margin-right: 24rpx;
color: rgba(0, 0, 0, 0.85);
}
.filling {
background: #2681FF;
border-radius: 8rpx;
color: #FFFFFF;
}
}
}
</style>

View File

@@ -0,0 +1,213 @@
<template>
<view class="container" style="paddingBottom:1rpx;">
<u-navbar
leftIconSize="40rpx"
leftIconColor="#333333"
title="借贷账户管理"
>
</u-navbar>
<view class="section">
<view class="section-title">{{ title}}</view>
<view class="form-view">
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="auto"
:labelStyle="{ color: '#333333', fontSize: '30rpx' }">
<u-form-item label="借贷名称" prop="name" required >
<u--input v-model="form.name" placeholder="请填写借贷名称"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="账号" prop="code" required >
<u--input v-model="form.code" placeholder="请填写账号"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="类型" prop="lendTypeName" required @click="handleShowTeam">
<u--input v-model="form.lendTypeName" 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="remark" labelPosition="top">
<u--textarea v-model="form.remark" placeholder="请填写备注" border="none" autoHeight inputAlign="right" count
maxlength="20000" style="padding:18rpx 0;"></u--textarea>
</u-form-item>
</u--form>
<view class="form-btn">
<u-button type="primary" text="提交" @click="submit"></u-button>
</view>
</view>
</view>
<u-toast ref="uToast"></u-toast>
<u-picker itemHeight="88" :show="showTeam" :columns="lendTypeList" keyName="dictLabel" @cancel="handleCancel"
@confirm="handleConfirm"></u-picker>
<u-datetime-picker
:show="datePickShow"
mode="date"
ref="createTimeRef"
@cancel="datePickShow=false"
@confirm="datePickConfirm"
itemHeight="88"
></u-datetime-picker>
</view>
</template>
<script setup>
import { getBankcardLend, addBankcardLend, updateBankcardLend } from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
const { proxy } = getCurrentInstance()
import dayjs from 'dayjs'
import {onLoad,onReady} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed ,getCurrentInstance }from "vue";
const datePickShow = ref(false)
const showTeam = ref(false)
const title = ref("借贷账户管理")
const lendTypeList = ref([])
const dateType = ref(1)
const data = reactive({
form: {
id: null,
name: null,
type: '3',
code: null,
openingBank: null,
activationDate: null,
billDate: null,
payDate: null,
delayPeriod: null,
creditLimit: null,
effectiveDate: null,
cvv: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null,
remark: null,
debitType: null
},
// dateType:'1',
rules: {
name: [{ type: 'string', required: true, message: '借贷名称不能为空', trigger: ['change', 'blur'] }],
code: [{ type: 'string', required: true, message: '账号不能为空', trigger: ['change', 'blur'] }],
lendTypeName: [{ type: 'string', required: true, message: '类型不能为空', trigger: ['change', 'blur'] }],
}
})
const { form, rules} = toRefs(data)
onLoad((option) => {
form.value.id = option.id
if(form.value.id!=null){
title.value="借贷账户管理-修改"
}else{
title.value="借贷账户管理-新增"
}
getDict()
})
onReady(() => {
form.value.activationDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
form.value.effectiveDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
})
function getDict() {
// 类型
getDicts('lend_type').then(res => {
lendTypeList.value =[res.data]
})
if(form.value.id!=null){
getBankcardLend(form.value.id).then(res => {
form.value = res.data
// 类型
getDicts('lend_type').then(result => {
form.value.lendTypeName=dictStr(form.value.lendType, result.data)
})
})
}
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function handleShowTeam() {
if (lendTypeList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '类型为空 ', type: 'warning'
})
} else {
showTeam.value = true
}
}
function handleConfirm(e) {
form.value.lendTypeName = e.value[0].dictLabel
form.value.lendType = e.value[0].dictValue
showTeam.value = false
}
function handleCancel() {
showTeam.value = false
}
function selectDate(type) {
dateType.value=type
datePickShow.value = true
proxy.$refs['createTimeRef'].innerValue = new Date().getTime()
}
function datePickConfirm(e) {
if(dateType.value===1){
form.value.activationDate = dayjs(e.value).format("YYYY-MM-DD")
}
if(dateType.value===2){
form.value.effectiveDate = dayjs(e.value).format("YYYY-MM-DD")
}
datePickShow.value = false
}
function submit() {
proxy.$refs['uForm'].validate().then(() => {
if (form.value.id != null) {
updateBankcardLend(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '修改成功', complete() {
uni.navigateTo({ url: `/pages/work/base/lend/list` })
}
})
})
}else {
addBankcardLend(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '新增成功', complete() {
uni.navigateTo({ url: `/pages/work/base/lend/list` })
}
})
})
}
})
}
</script>
<style lang="scss" scoped>
.section {
margin: 24rpx;
padding: 16rpx 24rpx;
background-color: #fff;
border-radius: 8rpx;
.section-title {
width: 360rpx;
color: #333333;
line-height: 44rpx;
font-size: 30rpx;
border-left: 6rpx solid #2681FF;
padding-left: 26rpx;
}
.form-view {
padding: 20rpx 0rpx 0 10rpx;
.form-btn {
padding-top: 20rpx;
}
}
}
</style>

View File

@@ -0,0 +1,92 @@
<template>
<view class="container" style="paddingBottom:1rpx;">
<u-navbar
leftIconSize="40rpx"
leftIconColor="#333333"
title="借贷账户详情"
>
</u-navbar>
<view class="section">
<u-cell-group>
<u-cell title="借贷名称:" titleStyle="font-weight:bolder" :value="detailInfo.name"></u-cell>
<u-cell title="账号:" titleStyle="font-weight:bolder" :value="detailInfo.code"></u-cell>
<u-cell title="类型:" titleStyle="font-weight:bolder" :value="detailInfo.lendType"></u-cell>
<u-cell title="备注:" titleStyle="font-weight:bolder" center :value="detailInfo.remark"> </u-cell>
</u-cell-group>
</view>
<u-toast ref="uToast"></u-toast>
</view>
</template>
<script setup>
import { getBankcardLend} from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
import {onLoad} from "@dcloudio/uni-app";
import {reactive ,toRefs,ref,computed }from "vue";
const id = ref('')
const data = reactive({
detailInfo: {}
})
const {detailInfo} = toRefs(data)
onLoad((option) => {
id.value = option.id
getInfo()
})
function getInfo() {
getBankcardLend(id.value).then(res => {
detailInfo.value = res.data
// 类型
getDicts('lend_type').then(result => {
detailInfo.value.lendType=dictStr(detailInfo.value.lendType, result.data)
})
})
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
</script>
<style lang="scss" scoped>
.section {
margin: 24rpx;
padding: 16rpx 24rpx;
background-color: #fff;
border-radius: 8rpx;
.section-title {
width: 280rpx;
color: #333333;
line-height: 44rpx;
font-size: 30rpx;
border-left: 6rpx solid #2681FF;
padding-left: 26rpx;
}
.content {
width: 647rpx;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
text-align: left;
}
.img-con {
display: flex;
flex-wrap: wrap;
gap: 20rpx
}
.form-view {
padding: 20rpx 0rpx 0 10rpx;
.form-btn {
padding-top: 20rpx;
}
}
}
</style>

View File

@@ -0,0 +1,367 @@
<template>
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u--input v-model="queryParams.name" border="false" placeholder="请输入储蓄卡名称" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
<u-icon :name="filterPanel ? 'arrow-up-fill' : 'arrow-down-fill'" color="#666666" size="28" label="筛选"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="filterPanel = !filterPanel"></u-icon>
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="handleAdd()"></u-icon>
<u-transition :show="filterPanel" mode="fade">
<view class="filter-panel" :style="{ height: `${windowHeight - 42}px` }">
<view class="filter-panel-content">
<view class="filter-title">类型</view>
<view class="state-list">
<view v-for="item in lendTypeList" :key="item.id" class="state-item"
:class="item.selected ? 'active' : ''" @click="selectStatus(item)">{{ item.dictLabel }}</view>
</view>
</view>
<view class="btn-box">
<u-button text="重置" style="margin-right:20rpx" @click="resetQuery()"></u-button>
<u-button type="primary" text="确定" @click="searchSubmit()"></u-button>
</view>
</view>
</u-transition>
</view>
</u-sticky>
<u-list @scrolltolower="loadmore" :spaceHeight="116" lowerThreshold="100">
<u-list-item v-for="(item, index) in listData" :key="index">
<view class="list-item">
<view class="item-header" @click="enterDetails(item)">
<u--text suffixIcon="arrow-right" lines="1" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
:text="item.name+'-'+item.code " size="30rpx" color="#333333" :bold="true"></u--text>
</view>
<view class="item-row">
<text class="row-label">类型</text>
<text class="row-value">{{ dictStr(item.lendType, lendTypeList) }}</text>
</view>
<view class="item-row">
<text class="row-label">备注</text>
<text class="row-value">{{ item.remark }}</text>
</view>
<view class="operate" >
<!-- <view class="btn filling" @click="enterDetails(item)">查看</view > -->
<view class="btn filling" @click="handleEdit(item)">修改</view>
<view class="btn filling" @click="handleDelete(item)">删除</view>
</view>
</view>
</u-list-item>
<view>
</view>
<u-loadmore :status="status" loadingIcon="semicircle" height="88" fontSize="32rpx" @loadmore="loadmore" />
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
</view>
</template>
<script setup>
import { listBankcardLend,delBankcardLend} from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
import {onLoad,onShow} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed }from "vue";
const pageNum = ref(1)
const listData = ref([])
const isShow = ref(false)
const status = ref('loadmore')
const lendTypeList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const data = reactive({
filterPanel: false,
queryParams: {
name: null,
type: '3'
}
})
const { filterPanel, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
onLoad(() => {
getDict()
getList()
});
onShow(() => {
if (isShow.value) {
getList()
isShow.value = false
}
});
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {
getList()
}
}
function getList() {
status.value = 'loading'
listBankcardLend({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => {
listData.value = listData.value.concat(res.rows)
if (listData.value.length < res.total) {
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
status.value = 'nomore'
})
}
function getDict() {
// 类型
getDicts('lend_type').then(res => {
lendTypeList.value = res.data
})
}
function settingConfirm(e) {
queryParams.value.settingId = e.value[0].settingId
queryParams.value.settingName = e.value[0].settingName
settingPickShow.value = false
}
function settingCancel() {
settingPickShow.value = false
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function selectStatus(item) {
queryParams.value.debitType = item.dictValue
lendTypeList.value.map(ele => {
if (ele.dictValue == item.dictValue) {
ele.selected = true
Reflect.set(ele, 'selected', true)
} else {
Reflect.set(ele, 'selected', false)
}
})
}
function searchSubmit() {
pageNum.value = 1
listData.value = []
getList()
filterPanel.value = false
}
function searchBlur() {
pageNum.value = 1
listData.value = []
getList()
}
function resetQuery() {
queryParams.value.name = '',
queryParams.value.type = '3'
lendTypeList.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
}
function enterDetails(item) {
uni.navigateTo({ url: `/pages/work/base/lend/details?id=${item.id}` })
}
function handleEdit(item) {
uni.navigateTo({ url: `/pages/work/base/lend/addEdit?id=${item.id}` })
isShow.value = true
}
function handleAdd() {
uni.navigateTo({ url: `/pages/work/base/lend/addEdit` })
isShow.value = true
}
function handleDelete(item) {
uni.showModal({
title: '提示',
content: '你确定要删除吗',
success: function (res) {
if (res.confirm) {
delBankcardLend(item.id)
uni.navigateTo({ url: `/pages/work/base/lend/list` })
} else if (res.cancel) {
console.log('取消');
}
}
});
}
</script>
<style lang="scss" scoped>
.btnAdd {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
display:float;
text-align: center;
}
.search-view {
padding: 12rpx 32rpx;
background-color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
margin-bottom: 24rpx;
.search-input {
background: #F5F5F5;
color: #333333;
margin-right: 36rpx;
}
.filter-panel {
width: 100%;
position: absolute;
left: 0;
top: 96rpx;
background-color: rgba(0, 0, 0, 0.5);
.filter-panel-content {
background-color: #ffff;
padding: 0 30rpx 30rpx;
.filter-title {
color: #000000;
font-size: 30rpx;
font-weight: 500;
padding: 30rpx 0;
}
.state-list {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.state-item {
width: 210rpx;
height: 72rpx;
border: 1rpx solid rgba(0, 0, 0, 0.25);
border-radius: 72rpx;
text-align: center;
line-height: 72rpx;
margin: 0 20rpx 20rpx 0;
font-size: 28rpx;
color: #000000;
}
.active {
background-color: rgba(222, 241, 255, 1);
border: 1rpx solid rgba(22, 119, 255, 1);
}
}
}
.btn-box {
display: flex;
padding: 24rpx 30rpx;
background-color: #fff;
box-shadow: 0rpx -10rpx 20rpx #EEEEEE;
}
}
}
.list-item {
margin: 0 24rpx 24rpx;
padding: 32rpx;
background-color: #fff;
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 16rpx;
.status {
.status-item {
width: 120rpx;
height: 44rpx;
text-align: center;
line-height: 44rpx;
border-radius: 4rpx;
font-size: 24rpx;
}
.status1 {
background: #F0F0F0;
color: #8C8C8C;
}
.status2 {
background: rgba(38, 129, 255, 0.2);
color: #2681FF;
}
.status3 {
background: #F7F7F7;
color: #2681FF;
}
.status4 {
background: rgba(255, 85, 51, 0.2);
color: #FF5533;
}
.status5 {
background: #F7F7F7;
color: rgba(0, 0, 0, 0.85);
}
.status7 {
background: rgba(255, 129, 51, 0.2);
color: #FF8133;
}
.status8 {
background: rgba(65, 217, 165, 0.2);
color: #41D9A5;
}
}
}
.item-row {
padding: 16rpx 0;
.row-label {
color: rgba(0, 0, 0, 0.55);
}
.row-value {
color: rgba(0, 0, 0, 0.85)
}
}
.operate {
display: flex;
justify-content: flex-end;
.btn {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
margin-left: 5rpx;
text-align: center;
}
.circulation {
background: rgba(0, 0, 0, 0.04);
margin-right: 24rpx;
color: rgba(0, 0, 0, 0.85);
}
.filling {
background: #2681FF;
border-radius: 8rpx;
color: #FFFFFF;
}
}
}
</style>

View File

@@ -1,237 +0,0 @@
<template>
<view class="mine-container" :style="{ height: `${windowHeight}px` }">
<!--顶部个人信息栏-->
<view class="header-section">
<view class="flex padding justify-between">
<view class="flex align-center">
<view v-if="!avatar" class="cu-avatar xl round bg-white">
<view class="iconfont icon-people text-gray icon"></view>
</view>
<image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
</image>
<view v-if="!name" @click="handleToLogin" class="login-tip">
点击登录
</view>
<view v-if="name" @click="handleToInfo" class="user-info">
<view class="u_title">
用户名{{ name }}
</view>
</view>
</view>
<view @click="handleToInfo" class="flex align-center">
<text>个人信息</text>
<view class="iconfont icon-right"></view>
</view>
</view>
</view>
<view class="content-section">
<view class="mine-actions grid col-4 text-center">
<view class="action-item" @click="handleJiaoLiuQun">
<view class="iconfont icon-friendfill text-pink icon"></view>
<text class="text">交流群</text>
</view>
<view class="action-item" @click="handleBuilding">
<view class="iconfont icon-service text-blue icon"></view>
<text class="text">在线客服</text>
</view>
<view class="action-item" @click="handleBuilding">
<view class="iconfont icon-community text-mauve icon"></view>
<text class="text">反馈社区</text>
</view>
<view class="action-item" @click="handleBuilding">
<view class="iconfont icon-dianzan text-green icon"></view>
<text class="text">点赞我们</text>
</view>
</view>
<view class="menu-list">
<view class="list-cell list-cell-arrow" @click="handleToEditInfo">
<view class="menu-item-box">
<view class="iconfont icon-user menu-icon"></view>
<view>编辑资料</view>
</view>
</view>
<view class="list-cell list-cell-arrow" @click="handleHelp">
<view class="menu-item-box">
<view class="iconfont icon-help menu-icon"></view>
<view>常见问题</view>
</view>
</view>
<view class="list-cell list-cell-arrow" @click="handleAbout">
<view class="menu-item-box">
<view class="iconfont icon-aixin menu-icon"></view>
<view>关于我们</view>
</view>
</view>
<view class="list-cell list-cell-arrow" @click="handleToSetting">
<view class="menu-item-box">
<view class="iconfont icon-setting menu-icon"></view>
<view>应用设置</view>
</view>
</view>
</view>
</view>
</view>
<!-- <view>
<uni-popup ref="popup" type="dialog">
<uni-popup-dialog type="info" cancelText="关闭" confirmText="退出"
title="通知" content="确定注销并退出系统吗"
@confirm="dialogConfirm"
@close="dialogClose">
</uni-popup-dialog>
</uni-popup>
</view> -->
</template>
<script setup>
import { ref } from "vue";
import config from '@/config.js'
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
const name = userStore.name;
const version = config.appInfo.version;
const avatar = ref(userStore.avatar);
const windowHeight = ref(uni.getSystemInfoSync().windowHeight - 50);
const popup = ref(null);
uni.$on('refresh', () => {
avatar.value = userStore.avatar;
})
console.log(avatar.value)
function handleToInfo() {
uni.navigateTo({
url: '/pages_mine/pages/info/index'
});
};
function handleToEditInfo() {
uni.navigateTo({
url: '/pages_mine/pages/info/edit'
});
};
function handleToSetting() {
uni.navigateTo({
url: '/pages_mine/pages/setting/index'
});
};
function handleToLogin() {
uni.reLaunch({
url: '/pages/login'
});
};
function handleToAvatar() {
uni.navigateTo({
url: '/pages_mine/pages/avatar/index'
});
};
function handleLogout() {
popup.value.open();
};
function dialogConfirm() {
//console.log('----------------点击确认------------')
userStore.logOut().then(() => {
uni.reLaunch({
url: '/pages/login'
});
})
};
function dialogClose() {
//console.log('点击关闭')
};
function handleHelp() {
uni.navigateTo({
url: '/pages_mine/pages/help/index'
});
};
function handleAbout() {
uni.navigateTo({
url: '/pages_mine/pages/about/index'
});
};
function handleJiaoLiuQun() {
uni.showToast({
title: 'QQ群133713780',
mask: false,
icon: "none",
duration: 1000
});
};
function handleBuilding() {
uni.showToast({
title: '模块建设中~',
mask: false,
icon: "none",
duration: 1000
});
}
</script>
<style lang="scss">
page {
background-color: #f5f6f7;
}
.mine-container {
width: 100%;
height: 100%;
.header-section {
padding: 15px 15px 45px 15px;
background-color: #3c96f3;
color: white;
.login-tip {
font-size: 18px;
margin-left: 10px;
}
.cu-avatar {
border: 2px solid #eaeaea;
.icon {
font-size: 40px;
}
}
.user-info {
margin-left: 15px;
.u_title {
font-size: 18px;
line-height: 30px;
}
}
}
.content-section {
position: relative;
top: -50px;
.mine-actions {
margin: 15px 15px;
padding: 20px 0px;
border-radius: 8px;
background-color: white;
.action-item {
.icon {
font-size: 28px;
}
.text {
display: block;
font-size: 13px;
margin: 8px 0px;
}
}
}
}
}
</style>

View File

@@ -96,7 +96,7 @@ const data = reactive({
creditCardName: [{ type: 'string', required: true, message: '信用卡不能为空', trigger: ['change', 'blur'] }],
billDate: [{ type: 'string', required: true, message: '账单日不能为空', trigger: ['change', 'blur'] }],
billStateName: [{ type: 'string', required: true, message: '账单状态不能为空', trigger: ['change', 'blur'] }],
billAmount: [{ type: 'string', required: true, message: '账单金额不能为空', trigger: ['change', 'blur'] }],
billAmount: [{ type: 'float', required: true, message: '账单金额不能为空', trigger: ['change', 'blur'] }],
}
})
const { form, queryBankCardLendParams, rules} = toRefs(data)

View File

@@ -140,9 +140,9 @@ const data = reactive({
onlineLendName: [{ type: 'string', required: true, message: '信用卡不能为空', trigger: ['change', 'blur'] }],
billDate: [{ type: 'string', required: true, message: '分期日期不能为空', trigger: ['change', 'blur'] }],
settleStateName: [{ type: 'string', required: true, message: '结清状态不能为空', trigger: ['change', 'blur'] }],
billAmount: [{ type: 'string', required: true, message: '分期金额不能为空', trigger: ['change', 'blur'] }],
period: [{ type: 'string', required: true, message: '分期期数不能为空', trigger: ['change', 'blur'] }],
balance: [{ type: 'string', required: true, message: '余额不能为空', trigger: ['change', 'blur'] }],
billAmount: [{ type: 'float', required: true, message: '分期金额不能为空', trigger: ['change', 'blur'] }],
period: [{ type: 'int', required: true, message: '分期期数不能为空', trigger: ['change', 'blur'] }],
balance: [{ type: 'float', required: true, message: '余额不能为空', trigger: ['change', 'blur'] }],
}
})
const { form, queryBankCardLendParams, rules} = toRefs(data)

View File

@@ -81,9 +81,9 @@ const data = reactive({
form: {},
rules: {
repaymentDate: [{ type: 'string', required: true, message: '还款日期不能为空', trigger: ['change', 'blur'] }],
// periods: [{ type: 'string', required: true, message: '还款期数不能为空', trigger: ['change', 'blur'] }],
// interest: [{ type: 'string', required: true, message: '利息不能为空', trigger: ['change', 'blur'] }],
// principal: [{ type: 'string', required: true, message: '应还本金不能为空', trigger: ['change', 'blur'] }],
periods: [{ type: 'int', required: true, message: '还款期数不能为空', trigger: ['change', 'blur'] }],
interest: [{ type: 'float', required: true, message: '利息不能为空', trigger: ['change', 'blur'] }],
principal: [{ type: 'float', required: true, message: '应还本金不能为空', trigger: ['change', 'blur'] }],
postingStateName: [{ type: 'string', required: true, message: '入账状态不能为空', trigger: ['change', 'blur'] }],
}
})

View File

@@ -0,0 +1,204 @@
<template>
<view class="container" style="paddingBottom:1rpx;">
<u-navbar
leftIconSize="40rpx"
leftIconColor="#333333"
title="期货账单"
>
</u-navbar>
<view class="section">
<view class="section-title">{{ title}}</view>
<view class="form-view">
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="auto"
:labelStyle="{ color: '#333333', fontSize: '30rpx' }">
<u-form-item label="期货账户" prop="futureStocksName" required @click="handleFutureStocks">
<u--input v-model="form.futureStocksName" 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="billDate" required @click="selectDate()">
<u--input v-model="form.billDate" disabled disabledColor="#ffffff" placeholder="请选择账单日" inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="期货收益" prop="billAmount" required >
<u--input v-model="form.billAmount" placeholder="请填写期货收益"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="备注" prop="remark" labelPosition="top">
<u--textarea v-model="form.remark" placeholder="请填写备注" border="none" autoHeight inputAlign="right" count
maxlength="20000" style="padding:18rpx 0;"></u--textarea>
</u-form-item>
</u--form>
<view class="form-btn">
<u-button type="primary" text="提交" @click="submit"></u-button>
</view>
</view>
</view>
<u-toast ref="uToast"></u-toast>
<u-picker itemHeight="88" :show="showTeam" :columns="billStateList" keyName="dictLabel" @cancel="handleCancel"
@confirm="handleConfirm"></u-picker>
<u-datetime-picker
:show="datePickShow"
mode="date"
ref="createTimeRef"
@cancel="datePickShow=false"
@confirm="datePickConfirm"
itemHeight="88"
></u-datetime-picker>
<u-picker itemHeight="88" :show="showFutureStocks" :columns="futureStocksBillList" keyName="nameCode" @cancel="handleFutureStocksCancel"
@confirm="handleFutureStocksConfirm"></u-picker>
</view>
</template>
<script setup>
import {getFutureStocksBill, addFutureStocksBill, updateFutureStocksBill } from '@/api/invest/futureStocksBill'
import { listFutureStocks } from '@/api/invest/futureStocks'
const { proxy } = getCurrentInstance()
import dayjs from 'dayjs'
import {onLoad,onReady} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed ,getCurrentInstance }from "vue";
const datePickShow = ref(false)
const showTeam = ref(false)
const showFutureStocks = ref(false)
const title = ref("期货账单")
const futureStocksBillList = ref([])
const billStateList = ref([])
const data = reactive({
form: {
id: null,
name: null,
billDate: null,
futureStocksId: null,
billDatePeriod: null,
billAmount: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null,
type: '1',
remark: null,
billYear: null,
billMonth: null
},
queryFutureStocksListParams: {
pageNum: 1,
type: '1',
pageSize: 1000
},
rules: {
futureStocksName: [{ type: 'string', required: true, message: '期货账户不能为空', trigger: ['change', 'blur'] }],
billDate: [{ type: 'string', required: true, message: '账单日不能为空', trigger: ['change', 'blur'] }],
billAmount: [{ type: 'float', required: true, message: '期货收益不能为空', trigger: ['change', 'blur'] }],
}
})
const { form, queryFutureStocksListParams, rules} = toRefs(data)
onLoad((option) => {
form.value.id = option.id
if(form.value.id!=null){
title.value="期货账单-修改"
}else{
title.value="期货账单-新增"
}
getDict()
})
onReady(() => {
form.value.billDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
})
function getDict() {
listFutureStocks(queryFutureStocksListParams.value).then((response) => {
futureStocksBillList.value = [response.rows]
})
if(form.value.id!=null){
getFutureStocksBill(form.value.id).then(res => {
form.value = res.data
form.value.futureStocksName = res.data.futureStocksNameCode
})
}
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function handleFutureStocks() {
if (futureStocksBillList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '期货账户为空 ', type: 'warning'
})
} else {
showFutureStocks.value = true
}
}
function handleFutureStocksConfirm(e) {
form.value.futureStocksName = e.value[0].nameCode
form.value.futureStocksId= e.value[0].id
showFutureStocks.value = false
}
function handleFutureStocksCancel() {
showFutureStocks.value = false
}
function selectDate() {
datePickShow.value = true
proxy.$refs['createTimeRef'].innerValue = new Date().getTime()
}
function datePickConfirm(e) {
form.value.createTime = dayjs(e.value).format("YYYY-MM-DD")
datePickShow.value = false
}
function submit() {
proxy.$refs['uForm'].validate().then(() => {
if (form.value.id != null) {
updateFutureStocksBill(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '修改成功', complete() {
uni.navigateTo({ url: `/pages/work/bill/futuresBill/list` })
}
})
})
}else {
addFutureStocksBill(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '新增成功', complete() {
uni.navigateTo({ url: `/pages/work/bill/futuresBill/list` })
}
})
})
}
})
}
</script>
<style lang="scss" scoped>
.section {
margin: 24rpx;
padding: 16rpx 24rpx;
background-color: #fff;
border-radius: 8rpx;
.section-title {
width: 360rpx;
color: #333333;
line-height: 44rpx;
font-size: 30rpx;
border-left: 6rpx solid #2681FF;
padding-left: 26rpx;
}
.form-view {
padding: 20rpx 0rpx 0 10rpx;
.form-btn {
padding-top: 20rpx;
}
}
}
</style>

View File

@@ -0,0 +1,404 @@
<template>
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u--input v-model="queryParams.time" border="false" disabled placeholder="请输入时间" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
<u-icon :name="filterPanel ? 'arrow-up-fill' : 'arrow-down-fill'" color="#666666" size="28" label="筛选"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="filterPanel = !filterPanel"></u-icon>
<u-transition :show="filterPanel" mode="fade">
<view class="filter-panel" :style="{ height: `${windowHeight - 42}px` }">
<view class="filter-panel-content">
<view class="filter-title">收益类型</view>
<view class="state-list">
<view v-for="item in dealTypeList" :key="item.id" class="state-item"
:class="item.selected ? 'active' : ''" @click="selectDealType(item)">{{ item.dictLabel }}</view>
</view>
</view>
<view class="btn-box">
<u-button text="重置" style="margin-right:20rpx" @click="resetQuery()"></u-button>
<u-button type="primary" text="确定" @click="searchSubmit()"></u-button>
</view>
<u-datetime-picker
:closeOnClickOverlay="true"
:show="timeShow"
v-model="time"
mode="datetime"
@close="openOrCloseDate"
@cancel="openOrCloseDate"
@confirm="confirm"
></u-datetime-picker>
</view>
</u-transition>
</view>
</u-sticky>
<u-list @scrolltolower="loadmore" :spaceHeight="116" lowerThreshold="100">
<u-list-item v-for="(item, index) in listData" :key="index">
<view class="list-item">
<view class="item-header">
<u--text lines="1" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
:text="item.accountName+ dictStr(item.dealType, dealTypeList)+'金额:'+item.amount" size="30rpx" color="#333333" :bold="true"></u--text>
</view>
<!-- <view class="item-row">
<text class="row-label">记账类型</text>
<text class="row-value">{{ dictStr(item.type, accountTypeList) }}</text>
</view> -->
<view class="item-row">
<text class="row-label">交易时间</text>
<text class="row-value">{{ item.createTime }}</text>
</view>
<view class="item-row">
<text class="row-label">交易金额</text>
<text class="row-value">{{ item.amount }}</text>
</view>
<view class="item-row">
<text class="row-label">当前余额</text>
<text class="row-value">{{ item.currentBalance }}</text>
</view>
<view class="item-row">
<text class="row-label">收益类型</text>
<text class="row-value">{{ dictStr(item.dealType, dealTypeList) }}</text>
</view>
<!-- <view class="item-row">
<text class="row-label">收益类型</text>
<text class="row-value">{{ dictStr(item.dealCategory, dealCategoryList) }}</text>
</view> -->
<view class="item-row">
<text class="row-label">备注</text>
<text class="row-value">{{ item.remark }}</text>
</view>
</view>
</u-list-item>
<view>
</view>
<u-loadmore :status="status" loadingIcon="semicircle" height="88" fontSize="32rpx" @loadmore="loadmore" />
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
</view>
</template>
<script setup>
import {
listAccountDealRecord,
} from '@/api/invest/accountDealRecord'
import { getDicts } from '@/api/system/dict/data.js'
import { timeHandler } from '@/utils/common.ts'
import {onLoad,onShow} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed }from "vue";
const pageNum = ref(1)
const listData = ref([])
const isShow = ref(false)
const status = ref('loadmore')
const accountTypeList = ref([])
const dealTypeList = ref([])
const dealCategoryList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const timeShow= ref(false)
const flag= ref(true)
const time =ref( Number(new Date()))
const data = reactive({
filterPanel: false,
queryParams: {
name: null,
type: null,
time: '',
accountId: null,
dealType: null,
dealCategory: '2'
}
})
const { filterPanel, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
onLoad((option) => {
queryParams.value.accountId = option.id
queryParams.value.time = option.billDatePeriod
queryParams.value.startTime = option.billDatePeriod.split('~')[0]
queryParams.value.endTime = option.billDatePeriod.split('~')[1]
getDict()
getList()
});
onShow(() => {
if (isShow.value) {
getList()
isShow.value = false
}
});
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
flag.value = data
}
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {
getList()
}
}
function getList() {
status.value = 'loading'
listAccountDealRecord({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => {
listData.value = listData.value.concat(res.rows)
if (listData.value.length < res.total) {
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
status.value = 'nomore'
})
}
function confirm(e) {
const date = timeHandler(new Date(e.value), '-', ':')
if (flag.value) {
queryParams.value.startTime = date
} else {
queryParams.value.endTime = date
}
timeShow.value = false
}
function getDict() {
// 收益类型
getDicts('profit_loss').then(res => {
dealTypeList.value = res.data
})
}
function settingConfirm(e) {
queryParams.value.settingId = e.value[0].settingId
queryParams.value.settingName = e.value[0].settingName
settingPickShow.value = false
}
function settingCancel() {
settingPickShow.value = false
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function selectDealType(item) {
queryParams.value.dealType = item.dictValue
dealTypeList.value.map(ele => {
if (ele.dictValue == item.dictValue) {
ele.selected = true
Reflect.set(ele, 'selected', true)
} else {
Reflect.set(ele, 'selected', false)
}
})
}
function searchSubmit() {
pageNum.value = 1
listData.value = []
getList()
filterPanel.value = false
}
function searchBlur() {
pageNum.value = 1
listData.value = []
getList()
}
function resetQuery() {
queryParams.value.name = ''
queryParams.value.type = ''
queryParams.value.dealType = ''
queryParams.value.dealCategory = '2'
accountTypeList.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
dealTypeList.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
dealCategoryList.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
}
function enterDetails(item) {
uni.navigateTo({ url: `/pages/work/accounts/accountDealRecord/details?id=${item.id}` })
}
</script>
<style lang="scss" scoped>
.btnAdd {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
display:float;
text-align: center;
}
.search-view {
padding: 12rpx 32rpx;
background-color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
margin-bottom: 24rpx;
.search-input {
background: #F5F5F5;
color: #333333;
margin-right: 36rpx;
}
.filter-panel {
width: 100%;
position: absolute;
left: 0;
top: 96rpx;
background-color: rgba(0, 0, 0, 0.5);
.filter-panel-content {
background-color: #ffff;
padding: 0 30rpx 30rpx;
.filter-title {
color: #000000;
font-size: 30rpx;
font-weight: 500;
padding: 30rpx 0;
}
.state-list {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.state-item {
width: 210rpx;
height: 72rpx;
border: 1rpx solid rgba(0, 0, 0, 0.25);
border-radius: 72rpx;
text-align: center;
line-height: 72rpx;
margin: 0 20rpx 20rpx 0;
font-size: 28rpx;
color: #000000;
}
.active {
background-color: rgba(222, 241, 255, 1);
border: 1rpx solid rgba(22, 119, 255, 1);
}
}
}
.btn-box {
display: flex;
padding: 24rpx 30rpx;
background-color: #fff;
box-shadow: 0rpx -10rpx 20rpx #EEEEEE;
}
}
}
.list-item {
margin: 0 24rpx 24rpx;
padding: 32rpx;
background-color: #fff;
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 16rpx;
.status {
.status-item {
width: 120rpx;
height: 44rpx;
text-align: center;
line-height: 44rpx;
border-radius: 4rpx;
font-size: 24rpx;
}
.status1 {
background: #F0F0F0;
color: #8C8C8C;
}
.status2 {
background: rgba(38, 129, 255, 0.2);
color: #2681FF;
}
.status3 {
background: #F7F7F7;
color: #2681FF;
}
.status4 {
background: rgba(255, 85, 51, 0.2);
color: #FF5533;
}
.status5 {
background: #F7F7F7;
color: rgba(0, 0, 0, 0.85);
}
.status7 {
background: rgba(255, 129, 51, 0.2);
color: #FF8133;
}
.status8 {
background: rgba(65, 217, 165, 0.2);
color: #41D9A5;
}
}
}
.item-row {
padding: 16rpx 0;
.row-label {
color: rgba(0, 0, 0, 0.55);
}
.row-value {
color: rgba(0, 0, 0, 0.85)
}
}
.operate {
display: flex;
justify-content: flex-end;
.btn {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
margin-left: 5rpx;
text-align: center;
}
.circulation {
background: rgba(0, 0, 0, 0.04);
margin-right: 24rpx;
color: rgba(0, 0, 0, 0.85);
}
.filling {
background: #2681FF;
border-radius: 8rpx;
color: #FFFFFF;
}
}
}
</style>

View File

@@ -0,0 +1,391 @@
<template>
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u-input v-model="queryParams.futureStocksName" border="false" type="select" @click="handleFutureStocks" placeholder="请选择期货账户" suffixIcon="search"
suffixIconStyle="color: #909399" class="search-input">
</u-input>
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="handleAdd()"></u-icon>
</view>
</u-sticky>
<u-list @scrolltolower="loadmore" :spaceHeight="116" lowerThreshold="100">
<u-list-item v-for="(item, index) in listData" :key="index">
<view class="list-item">
<view class="item-header" @click="enterDetails(item)">
<u--text suffixIcon="arrow-right" lines="1" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
:text="item.futureStocksNameCode" size="30rpx" color="#333333" :bold="true"></u--text>
</view>
<view class="item-row">
<text class="row-label">账单名称</text>
<text class="row-value">{{ item.name }}</text>
</view>
<view class="item-row">
<text class="row-label">账单周期</text>
<text class="row-value">{{ item.billDatePeriod }}</text>
</view>
<view class="item-row">
<text class="row-label">期货收益</text>
<text class="row-value">{{ item.billAmount }}</text>
</view>
<view class="operate" >
<view class="btn filling" @click="enterDetails(item)">账单明细</view >
<view class="btn filling" @click="handleEdit(item)">修改</view>
<view class="btn filling" @click="handleDelete(item)">删除</view>
</view>
</view>
</u-list-item>
<view>
</view>
<u-loadmore :status="status" loadingIcon="semicircle" height="88" fontSize="32rpx" @loadmore="loadmore" />
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
<u-picker itemHeight="88" :show="showFutureStocks" :columns="futureStocksBillList" keyName="nameCode" @cancel="handleFutureStocksCancel"
@confirm="handleFutureStocksConfirm"></u-picker>
</view>
</template>
<script setup>
import { listFutureStocksBill, delFutureStocksBill } from '@/api/invest/futureStocksBill'
import { getDicts } from '@/api/system/dict/data.js'
import { listFutureStocks } from '@/api/invest/futureStocks'
import {onLoad,onShow} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed }from "vue";
const pageNum = ref(1)
const listData = ref([])
const isShow = ref(false)
const status = ref('loadmore')
const billStateList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const showFutureStocks = ref(false)
const futureStocksBillList = ref([])
const data = reactive({
filterPanel: false,
queryFutureStocksListParams: {
pageNum: 1,
type: '1',
pageSize: 100
},
queryParams: {
futureStocksId: null,
name: '',
type: '1'
}
})
const { filterPanel, queryFutureStocksListParams, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
onLoad(() => {
getDict()
getList()
});
onShow(() => {
if (isShow.value) {
getList()
isShow.value = false
}
});
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {
getList()
}
}
function getList() {
status.value = 'loading'
listFutureStocksBill({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => {
listData.value = listData.value.concat(res.rows)
if (listData.value.length < res.total) {
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
status.value = 'nomore'
})
}
function getDict() {
listFutureStocks(queryFutureStocksListParams.value).then((response) => {
futureStocksBillList.value = [response.rows]
})
// 账单状态
getDicts('bill_state').then(res => {
billStateList.value = res.data
})
}
function settingConfirm(e) {
queryParams.value.settingId = e.value[0].settingId
queryParams.value.settingName = e.value[0].settingName
settingPickShow.value = false
}
function settingCancel() {
settingPickShow.value = false
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function selectStatus(item) {
queryParams.value.billState = item.dictValue
billStateList.value.map(ele => {
if (ele.dictValue == item.dictValue) {
ele.selected = true
Reflect.set(ele, 'selected', true)
} else {
Reflect.set(ele, 'selected', false)
}
})
}
function handleFutureStocks() {
if (futureStocksBillList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '期货账户为空 ', type: 'warning'
})
} else {
showFutureStocks.value = true
}
}
function handleFutureStocksConfirm(e) {
queryParams.value.futureStocksName = e.value[0].nameCode
queryParams.value.futureStocksId= e.value[0].id
showFutureStocks.value = false
pageNum.value = 1
listData.value = []
getList()
}
function handleFutureStocksCancel() {
showFutureStocks.value = false
}
function searchSubmit() {
pageNum.value = 1
listData.value = []
getList()
filterPanel.value = false
}
function searchBlur() {
pageNum.value = 1
listData.value = []
getList()
}
function resetQuery() {
queryParams.value.name = '',
queryParams.value.futureStocksName = '',
queryParams.value.futureStocksId= '',
queryParams.value.type = '1'
billStateList.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
}
function enterDetails(item) {
uni.navigateTo({ url: `/pages/work/bill/futuresBill/details?id=${item.futureStocksId}&billDatePeriod=${item.billDatePeriod}` })
}
function handleEdit(item) {
uni.navigateTo({ url: `/pages/work/bill/futuresBill/addEdit?id=${item.id}` })
isShow.value = true
}
function handleAdd() {
uni.navigateTo({ url: `/pages/work/bill/futuresBill/addEdit` })
isShow.value = true
}
function handleDelete(item) {
uni.showModal({
title: '提示',
content: '你确定要删除吗',
success: function (res) {
if (res.confirm) {
delFutureStocksBill(item.id)
uni.navigateTo({ url: `/pages/work/bill/futuresBill/list` })
} else if (res.cancel) {
console.log('取消');
}
}
});
}
</script>
<style lang="scss" scoped>
.btnAdd {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
display:float;
text-align: center;
}
.search-view {
padding: 12rpx 32rpx;
background-color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
margin-bottom: 24rpx;
.search-input {
background: #F5F5F5;
color: #333333;
margin-right: 36rpx;
}
.filter-panel {
width: 100%;
position: absolute;
left: 0;
top: 96rpx;
background-color: rgba(0, 0, 0, 0.5);
.filter-panel-content {
background-color: #ffff;
padding: 0 30rpx 30rpx;
.filter-title {
color: #000000;
font-size: 30rpx;
font-weight: 500;
padding: 30rpx 0;
}
.state-list {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.state-item {
width: 210rpx;
height: 72rpx;
border: 1rpx solid rgba(0, 0, 0, 0.25);
border-radius: 72rpx;
text-align: center;
line-height: 72rpx;
margin: 0 20rpx 20rpx 0;
font-size: 28rpx;
color: #000000;
}
.active {
background-color: rgba(222, 241, 255, 1);
border: 1rpx solid rgba(22, 119, 255, 1);
}
}
}
.btn-box {
display: flex;
padding: 24rpx 30rpx;
background-color: #fff;
box-shadow: 0rpx -10rpx 20rpx #EEEEEE;
}
}
}
.list-item {
margin: 0 24rpx 24rpx;
padding: 32rpx;
background-color: #fff;
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 16rpx;
.status {
.status-item {
width: 120rpx;
height: 44rpx;
text-align: center;
line-height: 44rpx;
border-radius: 4rpx;
font-size: 24rpx;
}
.status1 {
background: #F0F0F0;
color: #8C8C8C;
}
.status2 {
background: rgba(38, 129, 255, 0.2);
color: #2681FF;
}
.status3 {
background: #F7F7F7;
color: #2681FF;
}
.status4 {
background: rgba(255, 85, 51, 0.2);
color: #FF5533;
}
.status5 {
background: #F7F7F7;
color: rgba(0, 0, 0, 0.85);
}
.status7 {
background: rgba(255, 129, 51, 0.2);
color: #FF8133;
}
.status8 {
background: rgba(65, 217, 165, 0.2);
color: #41D9A5;
}
}
}
.item-row {
padding: 16rpx 0;
.row-label {
color: rgba(0, 0, 0, 0.55);
}
.row-value {
color: rgba(0, 0, 0, 0.85)
}
}
.operate {
display: flex;
justify-content: flex-end;
.btn {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
margin-left: 5rpx;
text-align: center;
}
.circulation {
background: rgba(0, 0, 0, 0.04);
margin-right: 24rpx;
color: rgba(0, 0, 0, 0.85);
}
.filling {
background: #2681FF;
border-radius: 8rpx;
color: #FFFFFF;
}
}
}
</style>

View File

@@ -140,9 +140,9 @@ const data = reactive({
onlineLendName: [{ type: 'string', required: true, message: '网贷机构不能为空', trigger: ['change', 'blur'] }],
billDate: [{ type: 'string', required: true, message: '借款日期不能为空', trigger: ['change', 'blur'] }],
settleStateName: [{ type: 'string', required: true, message: '结清状态不能为空', trigger: ['change', 'blur'] }],
billAmount: [{ type: 'string', required: true, message: '借款金额不能为空', trigger: ['change', 'blur'] }],
period: [{ type: 'string', required: true, message: '借款期数不能为空', trigger: ['change', 'blur'] }],
balance: [{ type: 'string', required: true, message: '余额不能为空', trigger: ['change', 'blur'] }],
installmentAmount: [{ type: 'float', required: true, message: '借款金额不能为空', trigger: ['change', 'blur'] }],
period: [{ type: 'int', required: true, message: '借款期数不能为空', trigger: ['change', 'blur'] }],
balance: [{ type: 'float', required: true, message: '余额不能为空', trigger: ['change', 'blur'] }],
}
})
const { form, queryBankCardLendParams, rules} = toRefs(data)

View File

@@ -81,9 +81,9 @@ const data = reactive({
form: {},
rules: {
repaymentDate: [{ type: 'string', required: true, message: '还款日期不能为空', trigger: ['change', 'blur'] }],
// periods: [{ type: 'string', required: true, message: '还款期数不能为空', trigger: ['change', 'blur'] }],
// interest: [{ type: 'string', required: true, message: '利息不能为空', trigger: ['change', 'blur'] }],
// principal: [{ type: 'string', required: true, message: '应还本金不能为空', trigger: ['change', 'blur'] }],
periods: [{ type: 'int', required: true, message: '还款期数不能为空', trigger: ['change', 'blur'] }],
interest: [{ type: 'float', required: true, message: '利息不能为空', trigger: ['change', 'blur'] }],
principal: [{ type: 'float', required: true, message: '应还本金不能为空', trigger: ['change', 'blur'] }],
postingStateName: [{ type: 'string', required: true, message: '入账状态不能为空', trigger: ['change', 'blur'] }],
}
})

View File

@@ -0,0 +1,269 @@
<template>
<view class="container" style="paddingBottom:1rpx;">
<u-navbar
leftIconSize="40rpx"
leftIconColor="#333333"
title="人情账单"
>
</u-navbar>
<view class="section">
<view class="section-title">{{ title}}</view>
<view class="form-view">
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="auto"
:labelStyle="{ color: '#333333', fontSize: '30rpx' }">
<u-form-item label="人情借贷" prop="onlineLendName" required @click="handleOnlineLend">
<u--input v-model="form.onlineLendName" 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="installmentAmount" required >
<u--input v-model="form.installmentAmount" placeholder="请填写借款金额"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="借款日期" prop="installmentDate" required @click="selectDate()">
<u--input v-model="form.installmentDate" disabled disabledColor="#ffffff" placeholder="请选择借款日期" inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="还款日期" prop="closeDate" >
<u--input v-model="form.closeDate" placeholder="请填写还款日期"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="结清状态" prop="settleStateName" required @click="handleShowTeam">
<u--input v-model="form.settleStateName" 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="remark" labelPosition="top">
<u--textarea v-model="form.remark" placeholder="请填写备注" border="none" autoHeight inputAlign="right" count
maxlength="20000" style="padding:18rpx 0;"></u--textarea>
</u-form-item>
</u--form>
<view class="form-btn">
<u-button type="primary" text="提交" @click="submit"></u-button>
</view>
</view>
</view>
<u-toast ref="uToast"></u-toast>
<u-picker itemHeight="88" :show="showTeam" :columns="settleStateList" keyName="dictLabel" @cancel="handleCancel"
@confirm="handleConfirm"></u-picker>
<u-datetime-picker
:show="datePickShow"
mode="date"
ref="createTimeRef"
@cancel="datePickShow=false"
@confirm="datePickConfirm"
itemHeight="88"
></u-datetime-picker>
<u-datetime-picker
:show="closeDatePickShow"
mode="date"
ref="closeTimeRef"
@cancel="closeDatePickShow=false"
@confirm="closeDatePickConfirm"
itemHeight="88"
></u-datetime-picker>
<u-picker itemHeight="88" :show="showOnlineLend" :columns="bankCardLendList" keyName="nameCode" @cancel="handleOnlineLendCancel"
@confirm="handleOnlineLendConfirm"></u-picker>
</view>
</template>
<script setup>
import {
getInstallmentHistory,
addInstallmentHistory,
updateInstallmentHistory
} from '@/api/invest/installmentHistory'
import { getDicts } from '@/api/system/dict/data.js'
import { listBankcardLend } from '@/api/invest/bankcardlend'
const { proxy } = getCurrentInstance()
import dayjs from 'dayjs'
import {onLoad,onReady} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed ,getCurrentInstance }from "vue";
const datePickShow = ref(false)
const showTeam = ref(false)
const showOnlineLend = ref(false)
const title = ref("人情账单")
const bankCardLendList = ref([])
const settleStateList = ref([])
const data = reactive({
form: {
id: null,
name: null,
type: '4',
code: null,
balance: null,
bankCardLendId: null,
installmentAmount: null,
installmentDate: null,
period: null,
repaidPeriod: null,
totalInterest: null,
interestRate: null,
dueDate: null,
closeDate: null,
state: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null,
remark: null
},
queryBankCardLendParams: {
pageNum: 1,
type: '3',
lendType: '2',
pageSize: 1000
},
rules: {
onlineLendName: [{ type: 'string', required: true, message: '人情借贷不能为空', trigger: ['change', 'blur'] }],
billDate: [{ type: 'string', required: true, message: '借款日期不能为空', trigger: ['change', 'blur'] }],
settleStateName: [{ type: 'string', required: true, message: '结清状态不能为空', trigger: ['change', 'blur'] }],
installmentAmount: [{ type: 'float', required: true, message: '借款金额不能为空', trigger: ['change', 'blur'] }]
}
})
const { form, queryBankCardLendParams, rules} = toRefs(data)
onLoad((option) => {
form.value.id = option.id
if(form.value.id!=null){
title.value="人情账单-修改"
}else{
title.value="人情账单-新增"
}
getDict()
})
onReady(() => {
form.value.installmentDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
})
function getDict() {
// 账单状态
getDicts('settle_state').then(res => {
settleStateList.value =[res.data]
})
listBankcardLend(queryBankCardLendParams.value).then((response) => {
bankCardLendList.value = [response.rows]
})
if(form.value.id!=null){
getInstallmentHistory(form.value.id).then(res => {
form.value = res.data
form.value.onlineLendName = res.data.bankName
// 类型
getDicts('settle_state').then(result => {
form.value.settleStateName=dictStr(form.value.state, result.data)
})
})
}
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function handleShowTeam() {
if (settleStateList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '结清状态为空 ', type: 'warning'
})
} else {
showTeam.value = true
}
}
function handleConfirm(e) {
form.value.settleStateName = e.value[0].dictLabel
form.value.state = e.value[0].dictValue
showTeam.value = false
}
function handleCancel() {
showTeam.value = false
}
function handleOnlineLend() {
if (bankCardLendList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '人情借贷为空 ', type: 'warning'
})
} else {
showOnlineLend.value = true
}
}
function handleOnlineLendConfirm(e) {
form.value.onlineLendName = e.value[0].nameCode
form.value.bankCardLendId= e.value[0].id
showOnlineLend.value = false
}
function handleOnlineLendCancel() {
showOnlineLend.value = false
}
function selectDate() {
datePickShow.value = true
proxy.$refs['createTimeRef'].innerValue = new Date().getTime()
}
function datePickConfirm(e) {
form.value.installmentDate = dayjs(e.value).format("YYYY-MM-DD")
datePickShow.value = false
}
function selectCloseDate() {
closeDatePickShow.value = true
proxy.$refs['closeTimeRef'].innerValue = new Date().getTime()
}
function closeDatePickConfirm(e) {
form.value.closeDate = dayjs(e.value).format("YYYY-MM-DD")
closeDatePickShow.value = false
}
function submit() {
proxy.$refs['uForm'].validate().then(() => {
if (form.value.id != null) {
updateInstallmentHistory(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '修改成功', complete() {
uni.navigateTo({ url: `/pages/work/bill/onlineLendHistory//list` })
}
})
})
}else {
addInstallmentHistory(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '新增成功', complete() {
uni.navigateTo({ url: `/pages/work/bill/onlineLendHistory//list` })
}
})
})
}
})
}
</script>
<style lang="scss" scoped>
.section {
margin: 24rpx;
padding: 16rpx 24rpx;
background-color: #fff;
border-radius: 8rpx;
.section-title {
width: 360rpx;
color: #333333;
line-height: 44rpx;
font-size: 30rpx;
border-left: 6rpx solid #2681FF;
padding-left: 26rpx;
}
.form-view {
padding: 20rpx 0rpx 0 10rpx;
.form-btn {
padding-top: 20rpx;
}
}
}
</style>

View File

@@ -0,0 +1,419 @@
<template>
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u-input v-model="queryParams.onlineLendName" border="false" type="select" @click="handleOnlineLend" placeholder="请选择人情借贷" suffixIcon="search"
suffixIconStyle="color: #909399" class="search-input">
</u-input>
<u-icon :name="filterPanel ? 'arrow-up-fill' : 'arrow-down-fill'" color="#666666" size="28" label="筛选"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="filterPanel = !filterPanel"></u-icon>
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="handleAdd()"></u-icon>
<u-transition :show="filterPanel" mode="fade">
<view class="filter-panel" :style="{ height: `${windowHeight - 42}px` }">
<view class="filter-panel-content">
<view class="filter-title">结清状态</view>
<view class="state-list">
<view v-for="item in settleStateList" :key="item.id" class="state-item"
:class="item.selected ? 'active' : ''" @click="selectStatus(item)">{{ item.dictLabel }}</view>
</view>
</view>
<view class="btn-box">
<u-button text="重置" style="margin-right:20rpx" @click="resetQuery()"></u-button>
<u-button type="primary" text="确定" @click="searchSubmit()"></u-button>
</view>
</view>
</u-transition>
</view>
</u-sticky>
<u-list @scrolltolower="loadmore" :spaceHeight="116" lowerThreshold="100">
<u-list-item v-for="(item, index) in listData" :key="index">
<view class="list-item">
<view class="item-header" @click="enterDetails(item)">
<u--text suffixIcon="arrow-right" lines="1" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
:text="item.bankNameCode" size="30rpx" color="#333333" :bold="true"></u--text>
</view>
<view class="item-row">
<text class="row-label">借款金额</text>
<text class="row-value">{{ item.installmentAmount }}</text>
</view>
<view class="item-row">
<text class="row-label">结清状态</text>
<text class="row-value">{{ dictStr(item.state, settleStateList) }}</text>
</view>
<view class="item-row">
<text class="row-label">借款日期</text>
<text class="row-value">{{ item.installmentDate }}</text>
</view>
<view class="item-row">
<text class="row-label">还款日期</text>
<text class="row-value">{{ item.closeDate }}</text>
</view>
<view class="item-row">
<text class="row-label">备注</text>
<text class="row-value">{{ item.remark }}</text>
</view>
<view class="operate" >
<view class="btn filling" @click="handleEdit(item)">修改</view>
<view class="btn filling" @click="handleDelete(item)">删除</view>
</view>
</view>
</u-list-item>
<view>
</view>
<u-loadmore :status="status" loadingIcon="semicircle" height="88" fontSize="32rpx" @loadmore="loadmore" />
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
<u-picker itemHeight="88" :show="showOnlineLend" :columns="bankCardLendList" keyName="nameCode" @cancel="handleOnlineLendCancel"
@confirm="handleOnlineLendConfirm"></u-picker>
</view>
</template>
<script setup>
import {
listInstallmentHistory,
delInstallmentHistory
} from '@/api/invest/installmentHistory'
import { getDicts } from '@/api/system/dict/data.js'
import { listBankcardLend } from '@/api/invest/bankcardlend'
import {onLoad,onShow} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed }from "vue";
const pageNum = ref(1)
const listData = ref([])
const isShow = ref(false)
const status = ref('loadmore')
const settleStateList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const showOnlineLend = ref(false)
const bankCardLendList = ref([])
const data = reactive({
filterPanel: false,
queryBankCardLendParams: {
pageNum: 1,
type: '3',
lendType: '2',
pageSize: 100
},
queryParams: {
name: null,
type: '4',
bankCardLendId: null,
state: '0'
}
})
const { filterPanel, queryBankCardLendParams, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
onLoad(() => {
getDict()
getList()
});
onShow(() => {
if (isShow.value) {
getList()
isShow.value = false
}
});
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {
getList()
}
}
function getList() {
status.value = 'loading'
listInstallmentHistory({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => {
listData.value = listData.value.concat(res.rows)
if (listData.value.length < res.total) {
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
status.value = 'nomore'
})
}
function getDict() {
listBankcardLend(queryBankCardLendParams.value).then((response) => {
bankCardLendList.value = [response.rows]
})
// 账单状态
getDicts('settle_state').then(res => {
settleStateList.value = res.data
})
}
function settingConfirm(e) {
queryParams.value.settingId = e.value[0].settingId
queryParams.value.settingName = e.value[0].settingName
settingPickShow.value = false
}
function settingCancel() {
settingPickShow.value = false
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function selectStatus(item) {
queryParams.value.state = item.dictValue
settleStateList.value.map(ele => {
if (ele.dictValue == item.dictValue) {
ele.selected = true
Reflect.set(ele, 'selected', true)
} else {
Reflect.set(ele, 'selected', false)
}
})
}
function handleOnlineLend() {
if (bankCardLendList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '人情借贷为空 ', type: 'warning'
})
} else {
showOnlineLend.value = true
}
}
function handleOnlineLendConfirm(e) {
queryParams.value.onlineLendName = e.value[0].nameCode
queryParams.value.bankCardLendId= e.value[0].id
showOnlineLend.value = false
pageNum.value = 1
listData.value = []
getList()
}
function handleOnlineLendCancel() {
showOnlineLend.value = false
}
function searchSubmit() {
pageNum.value = 1
listData.value = []
getList()
filterPanel.value = false
}
function searchBlur() {
pageNum.value = 1
listData.value = []
getList()
}
function resetQuery() {
queryParams.value.bankCardLendId = '',
queryParams.value.state= '0',
queryParams.value.type = '4'
settleStateList.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
}
function enterDetails(item) {
uni.navigateTo({ url: `/pages/work/bill/peopleLendHistory/addEdit?id=${item.id}` })
}
function handleEdit(item) {
uni.navigateTo({ url: `/pages/work/bill/peopleLendHistory/addEdit?id=${item.id}` })
isShow.value = true
}
function handleAdd() {
uni.navigateTo({ url: `/pages/work/bill/peopleLendHistory/addEdit` })
isShow.value = true
}
function handleDelete(item) {
uni.showModal({
title: '提示',
content: '你确定要删除吗',
success: function (res) {
if (res.confirm) {
delInstallmentHistory(item.id)
uni.navigateTo({ url: `/pages/work/bill/peopleLendHistory/list` })
} else if (res.cancel) {
console.log('取消');
}
}
});
}
</script>
<style lang="scss" scoped>
.btnAdd {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
display:float;
text-align: center;
}
.search-view {
padding: 12rpx 32rpx;
background-color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
margin-bottom: 24rpx;
.search-input {
background: #F5F5F5;
color: #333333;
margin-right: 36rpx;
}
.filter-panel {
width: 100%;
position: absolute;
left: 0;
top: 96rpx;
background-color: rgba(0, 0, 0, 0.5);
.filter-panel-content {
background-color: #ffff;
padding: 0 30rpx 30rpx;
.filter-title {
color: #000000;
font-size: 30rpx;
font-weight: 500;
padding: 30rpx 0;
}
.state-list {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.state-item {
width: 210rpx;
height: 72rpx;
border: 1rpx solid rgba(0, 0, 0, 0.25);
border-radius: 72rpx;
text-align: center;
line-height: 72rpx;
margin: 0 20rpx 20rpx 0;
font-size: 28rpx;
color: #000000;
}
.active {
background-color: rgba(222, 241, 255, 1);
border: 1rpx solid rgba(22, 119, 255, 1);
}
}
}
.btn-box {
display: flex;
padding: 24rpx 30rpx;
background-color: #fff;
box-shadow: 0rpx -10rpx 20rpx #EEEEEE;
}
}
}
.list-item {
margin: 0 24rpx 24rpx;
padding: 32rpx;
background-color: #fff;
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 16rpx;
.status {
.status-item {
width: 120rpx;
height: 44rpx;
text-align: center;
line-height: 44rpx;
border-radius: 4rpx;
font-size: 24rpx;
}
.status1 {
background: #F0F0F0;
color: #8C8C8C;
}
.status2 {
background: rgba(38, 129, 255, 0.2);
color: #2681FF;
}
.status3 {
background: #F7F7F7;
color: #2681FF;
}
.status4 {
background: rgba(255, 85, 51, 0.2);
color: #FF5533;
}
.status5 {
background: #F7F7F7;
color: rgba(0, 0, 0, 0.85);
}
.status7 {
background: rgba(255, 129, 51, 0.2);
color: #FF8133;
}
.status8 {
background: rgba(65, 217, 165, 0.2);
color: #41D9A5;
}
}
}
.item-row {
padding: 16rpx 0;
.row-label {
color: rgba(0, 0, 0, 0.55);
}
.row-value {
color: rgba(0, 0, 0, 0.85)
}
}
.operate {
display: flex;
justify-content: flex-end;
.btn {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
margin-left: 5rpx;
text-align: center;
}
.circulation {
background: rgba(0, 0, 0, 0.04);
margin-right: 24rpx;
color: rgba(0, 0, 0, 0.85);
}
.filling {
background: #2681FF;
border-radius: 8rpx;
color: #FFFFFF;
}
}
}
</style>

View File

@@ -0,0 +1,204 @@
<template>
<view class="container" style="paddingBottom:1rpx;">
<u-navbar
leftIconSize="40rpx"
leftIconColor="#333333"
title="股票账单"
>
</u-navbar>
<view class="section">
<view class="section-title">{{ title}}</view>
<view class="form-view">
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="auto"
:labelStyle="{ color: '#333333', fontSize: '30rpx' }">
<u-form-item label="股票账户" prop="futureStocksName" required @click="handleFutureStocks">
<u--input v-model="form.futureStocksName" 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="billDate" required @click="selectDate()">
<u--input v-model="form.billDate" disabled disabledColor="#ffffff" placeholder="请选择账单日" inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="股票收益" prop="billAmount" required >
<u--input v-model="form.billAmount" placeholder="请填写股票收益"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="备注" prop="remark" labelPosition="top">
<u--textarea v-model="form.remark" placeholder="请填写备注" border="none" autoHeight inputAlign="right" count
maxlength="20000" style="padding:18rpx 0;"></u--textarea>
</u-form-item>
</u--form>
<view class="form-btn">
<u-button type="primary" text="提交" @click="submit"></u-button>
</view>
</view>
</view>
<u-toast ref="uToast"></u-toast>
<u-picker itemHeight="88" :show="showTeam" :columns="billStateList" keyName="dictLabel" @cancel="handleCancel"
@confirm="handleConfirm"></u-picker>
<u-datetime-picker
:show="datePickShow"
mode="date"
ref="createTimeRef"
@cancel="datePickShow=false"
@confirm="datePickConfirm"
itemHeight="88"
></u-datetime-picker>
<u-picker itemHeight="88" :show="showFutureStocks" :columns="futureStocksBillList" keyName="nameCode" @cancel="handleFutureStocksCancel"
@confirm="handleFutureStocksConfirm"></u-picker>
</view>
</template>
<script setup>
import {getFutureStocksBill, addFutureStocksBill, updateFutureStocksBill } from '@/api/invest/futureStocksBill'
import { listFutureStocks } from '@/api/invest/futureStocks'
const { proxy } = getCurrentInstance()
import dayjs from 'dayjs'
import {onLoad,onReady} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed ,getCurrentInstance }from "vue";
const datePickShow = ref(false)
const showTeam = ref(false)
const showFutureStocks = ref(false)
const title = ref("股票账单")
const futureStocksBillList = ref([])
const billStateList = ref([])
const data = reactive({
form: {
id: null,
name: null,
billDate: null,
futureStocksId: null,
billDatePeriod: null,
billAmount: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null,
type: '2',
remark: null,
billYear: null,
billMonth: null
},
queryFutureStocksListParams: {
pageNum: 1,
type: '2',
pageSize: 1000
},
rules: {
futureStocksName: [{ type: 'string', required: true, message: '股票账户不能为空', trigger: ['change', 'blur'] }],
billDate: [{ type: 'string', required: true, message: '账单日不能为空', trigger: ['change', 'blur'] }],
billAmount: [{ type: 'float', required: true, message: '股票收益不能为空', trigger: ['change', 'blur'] }],
}
})
const { form, queryFutureStocksListParams, rules} = toRefs(data)
onLoad((option) => {
form.value.id = option.id
if(form.value.id!=null){
title.value="股票账单-修改"
}else{
title.value="股票账单-新增"
}
getDict()
})
onReady(() => {
form.value.billDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
})
function getDict() {
listFutureStocks(queryFutureStocksListParams.value).then((response) => {
futureStocksBillList.value = [response.rows]
})
if(form.value.id!=null){
getFutureStocksBill(form.value.id).then(res => {
form.value = res.data
form.value.futureStocksName = res.data.futureStocksNameCode
})
}
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function handleFutureStocks() {
if (futureStocksBillList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '股票账户为空 ', type: 'warning'
})
} else {
showFutureStocks.value = true
}
}
function handleFutureStocksConfirm(e) {
form.value.futureStocksName = e.value[0].nameCode
form.value.futureStocksId= e.value[0].id
showFutureStocks.value = false
}
function handleFutureStocksCancel() {
showFutureStocks.value = false
}
function selectDate() {
datePickShow.value = true
proxy.$refs['createTimeRef'].innerValue = new Date().getTime()
}
function datePickConfirm(e) {
form.value.createTime = dayjs(e.value).format("YYYY-MM-DD")
datePickShow.value = false
}
function submit() {
proxy.$refs['uForm'].validate().then(() => {
if (form.value.id != null) {
updateFutureStocksBill(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '修改成功', complete() {
uni.navigateTo({ url: `/pages/work/bill/stocksBill/list` })
}
})
})
}else {
addFutureStocksBill(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '新增成功', complete() {
uni.navigateTo({ url: `/pages/work/bill/stocksBill/list` })
}
})
})
}
})
}
</script>
<style lang="scss" scoped>
.section {
margin: 24rpx;
padding: 16rpx 24rpx;
background-color: #fff;
border-radius: 8rpx;
.section-title {
width: 360rpx;
color: #333333;
line-height: 44rpx;
font-size: 30rpx;
border-left: 6rpx solid #2681FF;
padding-left: 26rpx;
}
.form-view {
padding: 20rpx 0rpx 0 10rpx;
.form-btn {
padding-top: 20rpx;
}
}
}
</style>

View File

@@ -0,0 +1,404 @@
<template>
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u--input v-model="queryParams.time" border="false" disabled placeholder="请输入时间" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
<u-icon :name="filterPanel ? 'arrow-up-fill' : 'arrow-down-fill'" color="#666666" size="28" label="筛选"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="filterPanel = !filterPanel"></u-icon>
<u-transition :show="filterPanel" mode="fade">
<view class="filter-panel" :style="{ height: `${windowHeight - 42}px` }">
<view class="filter-panel-content">
<view class="filter-title">收益类型</view>
<view class="state-list">
<view v-for="item in dealTypeList" :key="item.id" class="state-item"
:class="item.selected ? 'active' : ''" @click="selectDealType(item)">{{ item.dictLabel }}</view>
</view>
</view>
<view class="btn-box">
<u-button text="重置" style="margin-right:20rpx" @click="resetQuery()"></u-button>
<u-button type="primary" text="确定" @click="searchSubmit()"></u-button>
</view>
<u-datetime-picker
:closeOnClickOverlay="true"
:show="timeShow"
v-model="time"
mode="datetime"
@close="openOrCloseDate"
@cancel="openOrCloseDate"
@confirm="confirm"
></u-datetime-picker>
</view>
</u-transition>
</view>
</u-sticky>
<u-list @scrolltolower="loadmore" :spaceHeight="116" lowerThreshold="100">
<u-list-item v-for="(item, index) in listData" :key="index">
<view class="list-item">
<view class="item-header">
<u--text lines="1" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
:text="item.accountName+ dictStr(item.dealType, dealTypeList)+'金额:'+item.amount" size="30rpx" color="#333333" :bold="true"></u--text>
</view>
<!-- <view class="item-row">
<text class="row-label">记账类型</text>
<text class="row-value">{{ dictStr(item.type, accountTypeList) }}</text>
</view> -->
<view class="item-row">
<text class="row-label">交易时间</text>
<text class="row-value">{{ item.createTime }}</text>
</view>
<view class="item-row">
<text class="row-label">交易金额</text>
<text class="row-value">{{ item.amount }}</text>
</view>
<view class="item-row">
<text class="row-label">当前余额</text>
<text class="row-value">{{ item.currentBalance }}</text>
</view>
<view class="item-row">
<text class="row-label">收益类型</text>
<text class="row-value">{{ dictStr(item.dealType, dealTypeList) }}</text>
</view>
<!-- <view class="item-row">
<text class="row-label">交易类别</text>
<text class="row-value">{{ dictStr(item.dealCategory, dealCategoryList) }}</text>
</view> -->
<view class="item-row">
<text class="row-label">备注</text>
<text class="row-value">{{ item.remark }}</text>
</view>
</view>
</u-list-item>
<view>
</view>
<u-loadmore :status="status" loadingIcon="semicircle" height="88" fontSize="32rpx" @loadmore="loadmore" />
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
</view>
</template>
<script setup>
import {
listAccountDealRecord,
} from '@/api/invest/accountDealRecord'
import { getDicts } from '@/api/system/dict/data.js'
import { timeHandler } from '@/utils/common.ts'
import {onLoad,onShow} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed }from "vue";
const pageNum = ref(1)
const listData = ref([])
const isShow = ref(false)
const status = ref('loadmore')
const accountTypeList = ref([])
const dealTypeList = ref([])
const dealCategoryList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const timeShow= ref(false)
const flag= ref(true)
const time =ref( Number(new Date()))
const data = reactive({
filterPanel: false,
queryParams: {
name: null,
type: null,
time: '',
accountId: null,
dealType: null,
dealCategory: '2'
}
})
const { filterPanel, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
onLoad((option) => {
queryParams.value.accountId = option.id
queryParams.value.time = option.billDatePeriod
queryParams.value.startTime = option.billDatePeriod.split('~')[0]
queryParams.value.endTime = option.billDatePeriod.split('~')[1]
getDict()
getList()
});
onShow(() => {
if (isShow.value) {
getList()
isShow.value = false
}
});
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
flag.value = data
}
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {
getList()
}
}
function getList() {
status.value = 'loading'
listAccountDealRecord({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => {
listData.value = listData.value.concat(res.rows)
if (listData.value.length < res.total) {
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
status.value = 'nomore'
})
}
function confirm(e) {
const date = timeHandler(new Date(e.value), '-', ':')
if (flag.value) {
queryParams.value.startTime = date
} else {
queryParams.value.endTime = date
}
timeShow.value = false
}
function getDict() {
// 收益类型
getDicts('profit_loss').then(res => {
dealTypeList.value = res.data
})
}
function settingConfirm(e) {
queryParams.value.settingId = e.value[0].settingId
queryParams.value.settingName = e.value[0].settingName
settingPickShow.value = false
}
function settingCancel() {
settingPickShow.value = false
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function selectDealType(item) {
queryParams.value.dealType = item.dictValue
dealTypeList.value.map(ele => {
if (ele.dictValue == item.dictValue) {
ele.selected = true
Reflect.set(ele, 'selected', true)
} else {
Reflect.set(ele, 'selected', false)
}
})
}
function searchSubmit() {
pageNum.value = 1
listData.value = []
getList()
filterPanel.value = false
}
function searchBlur() {
pageNum.value = 1
listData.value = []
getList()
}
function resetQuery() {
queryParams.value.name = ''
queryParams.value.type = ''
queryParams.value.endTime = ''
queryParams.value.dealCategory = '2'
accountTypeList.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
dealTypeList.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
dealCategoryList.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
}
function enterDetails(item) {
uni.navigateTo({ url: `/pages/work/accounts/accountDealRecord/details?id=${item.id}` })
}
</script>
<style lang="scss" scoped>
.btnAdd {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
display:float;
text-align: center;
}
.search-view {
padding: 12rpx 32rpx;
background-color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
margin-bottom: 24rpx;
.search-input {
background: #F5F5F5;
color: #333333;
margin-right: 36rpx;
}
.filter-panel {
width: 100%;
position: absolute;
left: 0;
top: 96rpx;
background-color: rgba(0, 0, 0, 0.5);
.filter-panel-content {
background-color: #ffff;
padding: 0 30rpx 30rpx;
.filter-title {
color: #000000;
font-size: 30rpx;
font-weight: 500;
padding: 30rpx 0;
}
.state-list {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.state-item {
width: 210rpx;
height: 72rpx;
border: 1rpx solid rgba(0, 0, 0, 0.25);
border-radius: 72rpx;
text-align: center;
line-height: 72rpx;
margin: 0 20rpx 20rpx 0;
font-size: 28rpx;
color: #000000;
}
.active {
background-color: rgba(222, 241, 255, 1);
border: 1rpx solid rgba(22, 119, 255, 1);
}
}
}
.btn-box {
display: flex;
padding: 24rpx 30rpx;
background-color: #fff;
box-shadow: 0rpx -10rpx 20rpx #EEEEEE;
}
}
}
.list-item {
margin: 0 24rpx 24rpx;
padding: 32rpx;
background-color: #fff;
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 16rpx;
.status {
.status-item {
width: 120rpx;
height: 44rpx;
text-align: center;
line-height: 44rpx;
border-radius: 4rpx;
font-size: 24rpx;
}
.status1 {
background: #F0F0F0;
color: #8C8C8C;
}
.status2 {
background: rgba(38, 129, 255, 0.2);
color: #2681FF;
}
.status3 {
background: #F7F7F7;
color: #2681FF;
}
.status4 {
background: rgba(255, 85, 51, 0.2);
color: #FF5533;
}
.status5 {
background: #F7F7F7;
color: rgba(0, 0, 0, 0.85);
}
.status7 {
background: rgba(255, 129, 51, 0.2);
color: #FF8133;
}
.status8 {
background: rgba(65, 217, 165, 0.2);
color: #41D9A5;
}
}
}
.item-row {
padding: 16rpx 0;
.row-label {
color: rgba(0, 0, 0, 0.55);
}
.row-value {
color: rgba(0, 0, 0, 0.85)
}
}
.operate {
display: flex;
justify-content: flex-end;
.btn {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
margin-left: 5rpx;
text-align: center;
}
.circulation {
background: rgba(0, 0, 0, 0.04);
margin-right: 24rpx;
color: rgba(0, 0, 0, 0.85);
}
.filling {
background: #2681FF;
border-radius: 8rpx;
color: #FFFFFF;
}
}
}
</style>

View File

@@ -0,0 +1,384 @@
<template>
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u-input v-model="queryParams.futureStocksName" border="false" type="select" @click="handleFutureStocks" placeholder="请选择股票账户" suffixIcon="search"
suffixIconStyle="color: #909399" class="search-input">
</u-input>
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="handleAdd()"></u-icon>
</view>
</u-sticky>
<u-list @scrolltolower="loadmore" :spaceHeight="116" lowerThreshold="100">
<u-list-item v-for="(item, index) in listData" :key="index">
<view class="list-item">
<view class="item-header" @click="enterDetails(item)">
<u--text suffixIcon="arrow-right" lines="1" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
:text="item.futureStocksNameCode" size="30rpx" color="#333333" :bold="true"></u--text>
</view>
<view class="item-row">
<text class="row-label">账单名称</text>
<text class="row-value">{{ item.name }}</text>
</view>
<view class="item-row">
<text class="row-label">账单周期</text>
<text class="row-value">{{ item.billDatePeriod }}</text>
</view>
<view class="item-row">
<text class="row-label">股票收益</text>
<text class="row-value">{{ item.billAmount }}</text>
</view>
<view class="operate" >
<view class="btn filling" @click="enterDetails(item)">账单明细</view >
<view class="btn filling" @click="handleEdit(item)">修改</view>
<view class="btn filling" @click="handleDelete(item)">删除</view>
</view>
</view>
</u-list-item>
<view>
</view>
<u-loadmore :status="status" loadingIcon="semicircle" height="88" fontSize="32rpx" @loadmore="loadmore" />
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
<u-picker itemHeight="88" :show="showFutureStocks" :columns="futureStocksBillList" keyName="nameCode" @cancel="handleFutureStocksCancel"
@confirm="handleFutureStocksConfirm"></u-picker>
</view>
</template>
<script setup>
import { listFutureStocksBill, delFutureStocksBill } from '@/api/invest/futureStocksBill'
import { getDicts } from '@/api/system/dict/data.js'
import { listFutureStocks } from '@/api/invest/futureStocks'
import {onLoad,onShow} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed }from "vue";
const pageNum = ref(1)
const listData = ref([])
const isShow = ref(false)
const status = ref('loadmore')
const billStateList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const showFutureStocks = ref(false)
const futureStocksBillList = ref([])
const data = reactive({
filterPanel: false,
queryFutureStocksListParams: {
pageNum: 1,
type: '2',
pageSize: 100
},
queryParams: {
futureStocksId: null,
name: '',
type: '2'
}
})
const { filterPanel, queryFutureStocksListParams, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
onLoad(() => {
getDict()
getList()
});
onShow(() => {
if (isShow.value) {
getList()
isShow.value = false
}
});
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {
getList()
}
}
function getList() {
status.value = 'loading'
listFutureStocksBill({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => {
listData.value = listData.value.concat(res.rows)
if (listData.value.length < res.total) {
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
status.value = 'nomore'
})
}
function getDict() {
listFutureStocks(queryFutureStocksListParams.value).then((response) => {
futureStocksBillList.value = [response.rows]
})
}
function settingConfirm(e) {
queryParams.value.settingId = e.value[0].settingId
queryParams.value.settingName = e.value[0].settingName
settingPickShow.value = false
}
function settingCancel() {
settingPickShow.value = false
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function selectStatus(item) {
queryParams.value.billState = item.dictValue
billStateList.value.map(ele => {
if (ele.dictValue == item.dictValue) {
ele.selected = true
Reflect.set(ele, 'selected', true)
} else {
Reflect.set(ele, 'selected', false)
}
})
}
function handleFutureStocks() {
if (futureStocksBillList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '股票账户为空 ', type: 'warning'
})
} else {
showFutureStocks.value = true
}
}
function handleFutureStocksConfirm(e) {
queryParams.value.futureStocksName = e.value[0].nameCode
queryParams.value.futureStocksId= e.value[0].id
showFutureStocks.value = false
pageNum.value = 1
listData.value = []
getList()
}
function handleFutureStocksCancel() {
showFutureStocks.value = false
}
function searchSubmit() {
pageNum.value = 1
listData.value = []
getList()
filterPanel.value = false
}
function searchBlur() {
pageNum.value = 1
listData.value = []
getList()
}
function resetQuery() {
queryParams.value.name = '',
queryParams.value.futureStocksName = '',
queryParams.value.futureStocksId= '',
queryParams.value.type = '1'
}
function enterDetails(item) {
uni.navigateTo({ url: `/pages/work/bill/stocksBill/details?id=${item.futureStocksId}&billDatePeriod=${item.billDatePeriod}` })
}
function handleEdit(item) {
uni.navigateTo({ url: `/pages/work/bill/stocksBill/addEdit?id=${item.id}` })
isShow.value = true
}
function handleAdd() {
uni.navigateTo({ url: `/pages/work/bill/stocksBill/addEdit` })
isShow.value = true
}
function handleDelete(item) {
uni.showModal({
title: '提示',
content: '你确定要删除吗',
success: function (res) {
if (res.confirm) {
delFutureStocksBill(item.id)
uni.navigateTo({ url: `/pages/work/bill/stocksBill/list` })
} else if (res.cancel) {
console.log('取消');
}
}
});
}
</script>
<style lang="scss" scoped>
.btnAdd {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
display:float;
text-align: center;
}
.search-view {
padding: 12rpx 32rpx;
background-color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
margin-bottom: 24rpx;
.search-input {
background: #F5F5F5;
color: #333333;
margin-right: 36rpx;
}
.filter-panel {
width: 100%;
position: absolute;
left: 0;
top: 96rpx;
background-color: rgba(0, 0, 0, 0.5);
.filter-panel-content {
background-color: #ffff;
padding: 0 30rpx 30rpx;
.filter-title {
color: #000000;
font-size: 30rpx;
font-weight: 500;
padding: 30rpx 0;
}
.state-list {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.state-item {
width: 210rpx;
height: 72rpx;
border: 1rpx solid rgba(0, 0, 0, 0.25);
border-radius: 72rpx;
text-align: center;
line-height: 72rpx;
margin: 0 20rpx 20rpx 0;
font-size: 28rpx;
color: #000000;
}
.active {
background-color: rgba(222, 241, 255, 1);
border: 1rpx solid rgba(22, 119, 255, 1);
}
}
}
.btn-box {
display: flex;
padding: 24rpx 30rpx;
background-color: #fff;
box-shadow: 0rpx -10rpx 20rpx #EEEEEE;
}
}
}
.list-item {
margin: 0 24rpx 24rpx;
padding: 32rpx;
background-color: #fff;
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 16rpx;
.status {
.status-item {
width: 120rpx;
height: 44rpx;
text-align: center;
line-height: 44rpx;
border-radius: 4rpx;
font-size: 24rpx;
}
.status1 {
background: #F0F0F0;
color: #8C8C8C;
}
.status2 {
background: rgba(38, 129, 255, 0.2);
color: #2681FF;
}
.status3 {
background: #F7F7F7;
color: #2681FF;
}
.status4 {
background: rgba(255, 85, 51, 0.2);
color: #FF5533;
}
.status5 {
background: #F7F7F7;
color: rgba(0, 0, 0, 0.85);
}
.status7 {
background: rgba(255, 129, 51, 0.2);
color: #FF8133;
}
.status8 {
background: rgba(65, 217, 165, 0.2);
color: #41D9A5;
}
}
}
.item-row {
padding: 16rpx 0;
.row-label {
color: rgba(0, 0, 0, 0.55);
}
.row-value {
color: rgba(0, 0, 0, 0.85)
}
}
.operate {
display: flex;
justify-content: flex-end;
.btn {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
margin-left: 5rpx;
text-align: center;
}
.circulation {
background: rgba(0, 0, 0, 0.04);
margin-right: 24rpx;
color: rgba(0, 0, 0, 0.85);
}
.filling {
background: #2681FF;
border-radius: 8rpx;
color: #FFFFFF;
}
}
}
</style>

View File

@@ -85,20 +85,20 @@ import auth from "@/plugins/auth"; // 建议使用auth进行鉴权操作
{ path: '/pages/work/bill/creditQueryRecord/list', text: '征信查询记录', icon: 'search', permission: 'invest:creditQueryRecord:list' }
])
const baseGridList=ref([
{ path: '/pages/work/base/pos/index', text: 'pos机管理', icon: 'shop-filled', permission: 'invest:posmachine:list' },
{ path: '/pages/work/base/credit/index', text: '信用卡管理', icon: 'wallet', permission: 'invest:bankcard:list' },
{ path: '/pages/page1/page1', text: '储蓄卡管理', icon: 'wallet-filled', permission: 'invest:bankcard:list' },
{ path: '/pages/page1/page1', text: '借贷账户管理', icon: 'upload', permission: 'invest:bankcard:list' },
{ path: '/pages/page1/page1', text: 'pos机管理', icon: 'shop-filled', permission: 'invest:posmachine:list' },
{ path: '/pages/work/base/creditCard/list', text: '信用卡管理', icon: 'wallet', permission: 'invest:bankcard:list' },
{ path: '/pages/work/base/debitCard/list', text: '储蓄卡管理', icon: 'wallet-filled', permission: 'invest:bankcard:list' },
{ path: '/pages/work/base/lend/list', text: '借贷账户管理', icon: 'upload', permission: 'invest:bankcard:list' },
{ path: '/pages/page1/page1', text: '股票账户管理', icon: 'calendar', permission: 'invest:futureStocks:list' },
{ path: '/pages/page1/page1', text: '期货账户管理', icon: 'paperplane-filled', permission: 'invest:futureStocks:list' }
])
const billGridList=ref([
{ path: '/pages/page1/page1', text: '期货账单', icon: 'map', permission: 'invest:futureStocksBill:list' },
{ path: '/pages/page1/page1', text: '股票账单', icon: 'paperplane', permission: 'invest:futureStocksBill:list' },
{ path: '/pages/work/bill/futuresBill/list', text: '期货账单', icon: 'map', permission: 'invest:futureStocksBill:list' },
{ path: '/pages/work/bill/stocksBill/list', text: '股票账单', icon: 'paperplane', permission: 'invest:futureStocksBill:list' },
{ path: '/pages/work/bill/onlineLendHistory/list', text: '网贷账单', icon: 'settings', permission: 'invest:installmentHistory:list' },
{ path: '/pages/work/bill/creditCardBill/list', text: '信用卡账单', icon: 'list', permission: 'invest:creditCardBill:list' },
{ path: '/pages/work/bill/creditInstallmentHistory/list', text: '信用卡分期账单', icon: 'bars', permission: 'invest:installmentHistory:list' },
{ path: '/pages/page1/page1', text: '人情账单', icon: 'staff-filled', permission: 'invest:installmentHistory:list' },
{ path: '/pages/work/bill/peopleLendHistory/list', text: '人情账单', icon: 'staff-filled', permission: 'invest:installmentHistory:list' },
{ path: '/pages/work/bill/creditQueryRecord/list', text: '征信查询记录', icon: 'search', permission: 'invest:creditQueryRecord:list' }
])
const accountGridList=ref([

View File

@@ -46,7 +46,7 @@ const useUserStore = defineStore("user", {
const avatar =
user.avatar == "" || user.avatar == null
? defAva
: import.meta.env.VITE_APP_BASE_API + user.avatar;
: user.avatar;
if (res.roles && res.roles.length > 0) {
// 验证返回的roles是否是一个非空数组