fix: 账户交易记录,新增交易子类别,自测bug修复。
This commit is contained in:
@@ -39,6 +39,11 @@
|
||||
inputAlign="right" border="none"></u--input>
|
||||
<u-icon slot="right" name="arrow-down"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="交易子类别" v-show="childCategoryShow" prop="childCategoryName" required @click="handleChildCategory">
|
||||
<u--input v-model="form.childCategoryName" 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>
|
||||
@@ -56,6 +61,10 @@
|
||||
@confirm="handleAccountNameConfirm"></u-picker>
|
||||
<u-picker itemHeight="88" :show="showDealCategory" :columns="dealCategoryList" keyName="dictLabel" @cancel="handleDealCategoryCancel"
|
||||
@confirm="handleDealCategoryConfirm"></u-picker>
|
||||
|
||||
<u-picker itemHeight="88" :show="showChildCategory" :columns="childCategoryList" keyName="dictLabel" @cancel="handleChildCategoryCancel"
|
||||
@confirm="handleChildCategoryConfirm"></u-picker>
|
||||
|
||||
<u-picker itemHeight="88" :show="showDealType" :columns="dealTypeList" keyName="dictLabel" @cancel="handleDealTypeCancel"
|
||||
@confirm="handleDealTypeConfirm"></u-picker>
|
||||
<u-datetime-picker
|
||||
@@ -82,11 +91,15 @@ const datePickShow = ref(false)
|
||||
const showAccountType = ref(false)
|
||||
const showAccountName = ref(false)
|
||||
const showDealCategory = ref(false)
|
||||
const showChildCategory = ref(false)
|
||||
const showDealType = ref(false)
|
||||
const title = ref("账户交易记录")
|
||||
const accountTypeList = ref([])
|
||||
const accountNameList = ref([])
|
||||
const dealCategoryList = ref([])
|
||||
const childCategoryList = ref([])
|
||||
const childCategoryShow = ref(true)
|
||||
|
||||
const dealTypeList = ref([])
|
||||
const data = reactive({
|
||||
form: {
|
||||
@@ -103,7 +116,8 @@ const data = reactive({
|
||||
delFlag: null,
|
||||
remark: null,
|
||||
currentBalance: null,
|
||||
dealCategory: '1'
|
||||
dealCategory: '1',
|
||||
childCategory: null
|
||||
},
|
||||
queryAccountParams: {
|
||||
pageNum: 1,
|
||||
@@ -117,6 +131,7 @@ const data = reactive({
|
||||
amount: [{type: 'number', required: true, message: '交易金额不能为空', trigger: ['change', 'blur'] }],
|
||||
dealTypeName: [{ required: true, message: '交易类型不能为空', trigger:['change', 'blur'] }],
|
||||
dealCategoryName: [{ required: true, message: '交易类别不能为空', trigger: ['change', 'blur'] }],
|
||||
childCategoryName: [{ required: true, message: '交易子类别不能为空', trigger: ['change', 'blur'] }],
|
||||
createTime: [{ required: true, message: '交易时间不能为空', trigger: ['change', 'blur'] }]
|
||||
}
|
||||
})
|
||||
@@ -150,10 +165,19 @@ onLoad((option) => {
|
||||
getDicts('deal_category').then(res => {
|
||||
dealCategoryList.value =[res.data]
|
||||
})
|
||||
// 子类型
|
||||
getDicts('daily_expenses').then(res => {
|
||||
childCategoryList.value =[res.data]
|
||||
})
|
||||
|
||||
listAccounts(queryAccountParams.value).then((response) => {
|
||||
accountNameList.value = [response.rows]
|
||||
})
|
||||
// 交易类别
|
||||
getDicts('daily_expenses').then(result => {
|
||||
form.value.childCategoryName=dictStr(form.value.childCategory, result.data)
|
||||
})
|
||||
// 交易类别
|
||||
getDicts('deal_category').then(result => {
|
||||
form.value.dealCategoryName=dictStr(form.value.dealCategory, result.data)
|
||||
})
|
||||
@@ -172,6 +196,10 @@ onLoad((option) => {
|
||||
// 交易类别
|
||||
getDicts('deal_category').then(result => {
|
||||
form.value.dealCategoryName=dictStr(form.value.dealCategory, result.data)
|
||||
})
|
||||
// 交易类别
|
||||
getDicts('daily_expenses').then(result => {
|
||||
form.value.childCategoryName=dictStr(form.value.childCategory, result.data)
|
||||
})
|
||||
// 记账类型
|
||||
getDicts('account_type').then(result => {
|
||||
@@ -241,7 +269,7 @@ getDicts('deal_category').then(result => {
|
||||
showAccountName.value = false
|
||||
}
|
||||
function handleDealCategory() {
|
||||
if (accountTypeList.value[0].length === 0) {
|
||||
if (dealCategoryList.value[0].length === 0) {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '交易类别为空 ', type: 'warning'
|
||||
})
|
||||
@@ -252,11 +280,38 @@ getDicts('deal_category').then(result => {
|
||||
function handleDealCategoryConfirm(e) {
|
||||
form.value.dealCategoryName = e.value[0].dictLabel
|
||||
form.value.dealCategory = e.value[0].dictValue
|
||||
//1表示日常支出,如果是日常支出,选择子类别,否则不显示子类别,且子类别与类别相同
|
||||
if (form.value.dealCategory === '1') {
|
||||
form.value.childCategory = null
|
||||
childCategoryShow.value = true
|
||||
} else {
|
||||
childCategoryShow.value = false
|
||||
form.value.childCategory = form.value.dealCategory
|
||||
}
|
||||
showDealCategory.value = false
|
||||
}
|
||||
function handleDealCategoryCancel() {
|
||||
showDealCategory.value = false
|
||||
}
|
||||
|
||||
function handleChildCategory() {
|
||||
if (childCategoryList.value[0].length === 0) {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '交易子类别为空 ', type: 'warning'
|
||||
})
|
||||
} else {
|
||||
showChildCategory.value = true
|
||||
}
|
||||
}
|
||||
function handleChildCategoryConfirm(e) {
|
||||
form.value.childCategoryName = e.value[0].dictLabel
|
||||
form.value.childCategory = e.value[0].dictValue
|
||||
showChildCategory.value = false
|
||||
}
|
||||
function handleChildCategoryCancel() {
|
||||
showChildCategory.value = false
|
||||
}
|
||||
|
||||
function handleDealType() {
|
||||
if (dealTypeList.value[0].length === 0) {
|
||||
proxy.$refs['uToast'].show({
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<u-cell title="账户类型:" titleStyle="font-weight:bolder" :value="detailInfo.type"></u-cell>
|
||||
<u-cell title="交易类型:" titleStyle="font-weight:bolder" :value="detailInfo.dealType"></u-cell>
|
||||
<u-cell title="交易类别:" titleStyle="font-weight:bolder" :value="detailInfo.dealCategory"></u-cell>
|
||||
<u-cell title="交易子类别:" titleStyle="font-weight:bolder" :value="detailInfo.childCategoryName"></u-cell>
|
||||
<u-cell title="交易金额:" titleStyle="font-weight:bolder" :value="detailInfo.amount"></u-cell>
|
||||
<u-cell title="当前余额:" titleStyle="font-weight:bolder" :value="detailInfo.currentBalance"></u-cell>
|
||||
<u-cell title="交易时间:" titleStyle="font-weight:bolder" :value="detailInfo.createTime"></u-cell>
|
||||
|
||||
@@ -111,6 +111,10 @@
|
||||
<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.childCategoryName }}</text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="row-label">备注:</text>
|
||||
<text class="row-value">{{ item.remark }}</text>
|
||||
|
||||
@@ -192,7 +192,7 @@ onLoad((option) => {
|
||||
updateCreditCardBill(form.value).then(res => {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '修改成功', complete() {
|
||||
uni.navigateTo({ url: `/pages/work/bill/creditCardBill//list` })
|
||||
uni.navigateTo({ url: `/pages/work/bill/creditCardBill/list` })
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -200,7 +200,7 @@ onLoad((option) => {
|
||||
addCreditCardBill(form.value).then(res => {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '新增成功', complete() {
|
||||
uni.navigateTo({ url: `/pages/work/bill/creditCardBill//list` })
|
||||
uni.navigateTo({ url: `/pages/work/bill/creditCardBill/list` })
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -250,7 +250,7 @@ onLoad((option) => {
|
||||
updateInstallmentHistory(form.value).then(res => {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '修改成功', complete() {
|
||||
uni.navigateTo({ url: `/pages/work/bill/onlineLendHistory//list` })
|
||||
uni.navigateTo({ url: `/pages/work/bill/onlineLendHistory/list` })
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -258,7 +258,7 @@ onLoad((option) => {
|
||||
addInstallmentHistory(form.value).then(res => {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '新增成功', complete() {
|
||||
uni.navigateTo({ url: `/pages/work/bill/onlineLendHistory//list` })
|
||||
uni.navigateTo({ url: `/pages/work/bill/onlineLendHistory/list` })
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -250,7 +250,7 @@ onLoad((option) => {
|
||||
updateInstallmentHistory(form.value).then(res => {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '修改成功', complete() {
|
||||
uni.navigateTo({ url: `/pages/work/bill/onlineLendHistory//list` })
|
||||
uni.navigateTo({ url: `/pages/work/bill/onlineLendHistory/list` })
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -258,7 +258,7 @@ onLoad((option) => {
|
||||
addInstallmentHistory(form.value).then(res => {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '新增成功', complete() {
|
||||
uni.navigateTo({ url: `/pages/work/bill/onlineLendHistory//list` })
|
||||
uni.navigateTo({ url: `/pages/work/bill/onlineLendHistory/list` })
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -225,7 +225,7 @@ onLoad((option) => {
|
||||
updateInstallmentHistory(form.value).then(res => {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '修改成功', complete() {
|
||||
uni.navigateTo({ url: `/pages/work/bill/onlineLendHistory//list` })
|
||||
uni.navigateTo({ url: `/pages/work/bill/onlineLendHistory/list` })
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -233,7 +233,7 @@ onLoad((option) => {
|
||||
addInstallmentHistory(form.value).then(res => {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '新增成功', complete() {
|
||||
uni.navigateTo({ url: `/pages/work/bill/onlineLendHistory//list` })
|
||||
uni.navigateTo({ url: `/pages/work/bill/onlineLendHistory/list` })
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user