Commit 2fa13a5e by chenwq

fix(financeManage): 修复财务管理系统中的多个问题

修复动态表格删除行时未触发输入框失焦事件的问题
调整价格限制函数参数从9位改为7位
统一分页参数currentPage为pageNum
优化表格样式和高度设置
修复金额验证提示信息错误
调整表格列固定和样式
优化图片预览逻辑
1 parent 334e11eb
......@@ -19,9 +19,9 @@
<el-table-column align="center" width="60px" label="序号" type="index" :index="
(index) =>
index +
((page.currentPage
? page.currentPage
: page.currentPage) -
((page.pageNum
? page.pageNum
: page.pageNum) -
1) * page.pageSize + 1
" />
<el-table-column label="订单编号" prop="orderCode" align="center"></el-table-column>
......@@ -57,7 +57,7 @@
</template>
</el-table-column>
</el-table>
<el-pagination background @current-change="jumpPage" :current-page.sync="page.currentPage" :page-size="page.pageSize" layout="total, prev, pager, next" :total="tableTotal" />
<el-pagination background @current-change="jumpPage" :current-page.sync="page.pageNum" :page-size="page.pageSize" layout="total, prev, pager, next" :total="tableTotal" />
<div class="selected_box" v-if="selectedData.length">
<span>已选订单:</span>
<el-tooltip class="item" :content="formatSelected(selectedData, 'all')" placement="right">
......@@ -142,7 +142,7 @@ export default {
tableTotal: 0,
page: {
pageSize: 10,
currentPage: 1
pageNum: 1
},
baseData: {
searchPayTypeList: deepClone(payTypeList)
......@@ -288,7 +288,7 @@ export default {
ymerchantId: this.infoForm?.yqMerchantId, // 对账园区店
merchantId: this.infoForm?.shopMerchantId, // 对账流量方
...searchFormSearch,
currentPage: this.page.currentPage,
pageNum: this.page.pageNum,
pageSize: this.page.pageSize,
// filterTransferAccounts: true, // 固定传参
// shopTrafficMoneyFlag: 'Y', // 固定传参
......@@ -296,7 +296,7 @@ export default {
}
},
jumpPage(page) {
this.page.currentPage = page
this.page.pageNum = page
this.getOrderList()
},
handleSearch() {
......@@ -311,7 +311,7 @@ export default {
payType: '',
orderGoodsName: ''
}
this.page.currentPage = 1
this.page.pageNum = 1
this.handleSearch()
},
......
<template>
<div class="dynamic-table-container">
{{configObj.title}}调整:<el-button type="default" style="padding: 8px 20px;" v-if="isEdit" @click="addRow">
<span class="title">{{configObj.title}}调整:</span><el-button type="default" style="padding: 8px 20px;" v-if="isEdit" @click="addRow">
添加事由
</el-button>
......@@ -121,11 +121,12 @@ export default {
deleteRow(index) {
this.tableData.splice(index, 1);
this.tableOldData = deepClone(this.tableData)
this.$emit('handleInputBlur')
},
handleInput(rowIdx, attr) {
const val = this.tableData[rowIdx][attr]
const oldVal = this.tableOldData[rowIdx][attr]
this.tableData[rowIdx][attr] = limitPrice(val, oldVal, 9, 2, '', '', 'priceReg_negative')
this.tableData[rowIdx][attr] = limitPrice(val, oldVal, 7, 2, '', '', 'priceReg_negative')
this.tableOldData[rowIdx][attr] = this.tableData[rowIdx][attr]
},
handleInputBlur() {
......@@ -146,8 +147,11 @@ export default {
<style lang="scss">
.dynamic-table-container {
box-sizing: border-box;
padding: 20px 20px 0 20px;
.title {
font-size: 14px;
}
.el-table--medium td {
padding: 4px 16px !important;
}
......
......@@ -7,7 +7,7 @@
<div>{{dateStr}}销售对账单</div>
<div>适用对象:{{billTmplInfo.billMerchantName}}</div>
</div>
<el-table v-loading="loading" :data="tableList" style="width: 100%" height="452px" ref="billMutiTable" show-summary :summary-method="getSummaries" :span-method="arraySpanMethod">
<el-table v-loading="loading" :data="tableList" style="width: 100%" height="652px" ref="billMutiTable" show-summary :summary-method="getSummaries" :span-method="arraySpanMethod">
<el-table-column v-for="(item, idx) in tableHeader" :key="idx" :label="item.moduleName">
<el-table-column v-for="(subItem, subIdx) in item.items" :key="subIdx" :prop="subItem.fieldCode" :label="subItem.fieldName" :width="subItem.width || '120px'">
<div class="tb-header-cell" slot="header">
......@@ -44,8 +44,8 @@
<div>总产值:{{ totalAmount }}元</div>
<div v-if="billTypeStr == 'traffic'">应收总额:{{ totalReceivable }}元</div>
<div>应付总额:{{ totalPayable }}元</div>
<div>线上分账总额:{{ totalSplitPaidAmount }}元</div>
<div>线下已付总额:{{ totalOfflinePaidAmount }}元</div>
<div v-if="billTypeStr == 'traffic'">线上分账总额:{{ totalSplitPaidAmount }}元</div>
<div v-if="billTypeStr == 'traffic'">线下已付总额:{{ totalOfflinePaidAmount }}元</div>
<div v-if="billTypeStr == 'traffic'">线下对账总额:{{ totalOfflineReconciliation }}元</div>
</div>
<div class="btn-box">
......@@ -138,14 +138,6 @@ export default {
optionLabel: 'confLabel',
optionsName: 'reconcileStatusList',
}, {
name: '备注',
source: 'ORDER',
attr: 'coverReceiverType',
type: 'select',
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'coverReceiverTypeList',
}, {
name: '订单时间',
source: 'ORDER',
attr: 'orderTime',
......@@ -225,14 +217,6 @@ export default {
optionLabel: 'confLabel',
optionsName: 'payTypeList',
}, {
name: '备注',
source: 'ORDER',
attr: 'coverReceiverType',
type: 'select',
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'coverReceiverTypeList',
}, {
name: '订单时间',
source: 'ORDER',
attr: 'orderTime',
......@@ -584,6 +568,9 @@ export default {
row.ORDER.payVoucherList.forEach(item => {
this.imgList.push(item.payVoucher)
})
if (!this.imgList.length) {
return true
}
this.imgVisible = !this.imgVisible
},
......@@ -648,9 +635,11 @@ export default {
}
}
.privacyDrawer {
box-sizing: border-box;
padding: 20px;
overflow: scroll;
height: calc(100% - 120px);
height: auto;
max-height: calc(100vh - 148px);
}
.flex {
display: flex;
......@@ -755,11 +744,11 @@ export default {
display: inline-block; /* 或者 inline */
}
.tb-cell {
padding: 6px;
padding: 0px 6px;
text-align: center;
}
::v-deep .el-table .cell {
padding: 6px !important;
padding: 0px 6px !important;
text-align: center;
}
::v-deep .el-table__footer-wrapper tbody td {
......@@ -812,6 +801,7 @@ export default {
align-items: center;
// text-align: right;
padding: 0 30px;
background: #ffffff;
.btn-box {
background: #ffffff;
width: 200px;
......
......@@ -26,9 +26,9 @@
</el-form-item>
</el-form>
</div>
<el-table v-loading="loading" :data="tableList" style="width: 100%" height="452px" ref="billMutiTable" show-summary :summary-method="getSummaries" :span-method="arraySpanMethod" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="tableList" style="width: 100%" height="652px" ref="billMutiTable" show-summary :summary-method="getSummaries" :span-method="arraySpanMethod" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" width="55"></el-table-column>
<el-table-column :fixed="[0].includes(idx)" v-for="(item, idx) in tableHeader" :key="idx" :label="item.moduleName">
<el-table-column :fixed="[0, 1, 2].includes(idx)" v-for="(item, idx) in tableHeader" :key="idx" :label="item.moduleName">
<el-table-column v-for="(subItem, subIdx) in item.items" :key="subIdx" :prop="subItem.fieldCode" :label="subItem.fieldName" :width="subItem.width || '120px'">
<div class="tb-header-cell" slot="header" slot-scope="scope">
<span>{{subItem.fieldName}}</span>
......@@ -89,8 +89,8 @@
<div v-else-if="subItem.fieldCode == 'tradeNo'" :class="['trade-no', scope.row.ORDER.payVoucherList && scope.row.ORDER.payVoucherList.length ? 'txt-blue': '' ]" @click="handleReviewImg(scope.row)">
{{ scope.row[subItem.extInfo.source || 'ORDER'][subItem.fieldCode] || '-' }}
</div>
<div v-else-if="scope.row[subItem.extInfo.source || 'ORDER'][subItem.fieldCode] === 0">0</div>
<div v-else>{{ scope.row[subItem.extInfo.source || 'ORDER'][subItem.fieldCode] || '-' }}</div>
<div v-else-if="scope.row[subItem.extInfo.source || 'ORDER'][subItem.fieldCode] === 0" :style="{ 'margin-right': subItem.fieldCode == 'customerName' ? '12px' : '0px' }">0</div>
<div v-else :style="{ 'margin-right': subItem.fieldCode == 'customerName' ? '12px' : '0px' }">{{ scope.row[subItem.extInfo.source || 'ORDER'][subItem.fieldCode] || '-' }}</div>
</div>
</div>
</el-table-column>
......@@ -112,8 +112,8 @@
<div>总产值:{{ totalAmount }}元</div>
<div v-if="billTypeStr == 'traffic'">应收总额:{{ totalReceivable }}元</div>
<div>应付总额:{{ totalPayable }}元</div>
<div>线上分账总额:{{ totalSplitPaidAmount }}元</div>
<div>线下已付总额:{{ totalOfflinePaidAmount }}元</div>
<div v-if="billTypeStr == 'traffic'">线上分账总额:{{ totalSplitPaidAmount }}元</div>
<div v-if="billTypeStr == 'traffic'">线下已付总额:{{ totalOfflinePaidAmount }}元</div>
<div v-if="billTypeStr == 'traffic'">线下对账总额:{{ totalOfflineReconciliation }}元</div>
</div>
<div class="btn-box">
......@@ -511,7 +511,7 @@ export default {
const min = 0
const max = Math.abs(this.tableList[rowIndex][totalPaymentObj.extInfo.source].totalPaymentAmount || 0)
if (value > max || value < min) {
errorTxt = `请输入小于${min}且大于${max}的数字`
errorTxt = `请输入${min}-${max}的数字`
} else if (value !== null && value !== undefined && value !== '') {
const decimalPart = String(value).split('.')[1]
if (decimalPart && decimalPart.length > 2) {
......@@ -536,7 +536,7 @@ export default {
max = Math.abs(max)
min = parseFloat((max * -1).toFixed(2))
if (value > max || value < min) {
errorTxt = `请输入小于${min}且大于${max}的数字`
errorTxt = `请输入${min}-${max}的数字`
} else if (value !== null && value !== undefined && value !== '') {
const decimalPart = String(value).split('.')[1]
if (decimalPart && decimalPart.length > 2) {
......@@ -549,10 +549,17 @@ export default {
// 线下已付金额
offlinePaidAmount: {
source: 'ORDER',
rule: (value) => {
rule: (value, rowIndex) => {
const totalPaymentObj = this.tmplFieldsList.find(item => item.fieldCode == 'totalPaymentAmount')
const orderList = this.tableList.filter(item => item.ORDER.id == this.tableList[rowIndex].ORDER.id)
var errorTxt = ''
const min = 0
const max = 999999
var min = 0
var max = 0
orderList.forEach(item => {
max = max + item[totalPaymentObj.extInfo.source].totalPaymentAmount
})
max = Math.abs(max)
min = parseFloat((max * -1).toFixed(2))
if (value < min || value > max) {
errorTxt = `请输入${min}-${max}的数字`
} else if (value !== null && value !== undefined && value !== '') {
......@@ -889,7 +896,7 @@ export default {
this.billTypeStr = this.billTmplInfo.billType == '1' ? 'traffic' : 'service'
console.log(this.billTmplInfo, 'this.billTmplInfo---')
this.dateStr = Util.dateFormate(this.billTmplInfo.startDate, 'YYYY年MM月DD日') + '~' + Util.dateFormate(this.billTmplInfo.endDate, 'YYYY年MM月DD日')
this.tmplFieldsList = JSON.parse(this.billTmplInfo.fieldsJson)
this.tmplFieldsList = JSON.parse(this.billTmplInfo.fixedFieldsJson)
console.log(this.tmplFieldsList, 'this.tmplFieldsList---')
this.originalOrderList = this.billTmplInfo?.orderPage?.list || []
this.orderId = this.billTmplInfo.id
......@@ -902,8 +909,9 @@ export default {
this.totalOfflinePaidAmount = this.billTmplInfo.totalOfflinePaidAmount
this.totalOfflineReconciliation = this.billTmplInfo.totalOfflineReconciliation
this.infoForm.tmplType = this.billTmplInfo.billType
this.infoForm.templateId = this.billTmplInfo.templateId
this.infoForm.templateId = this.billTmplInfo.templateId || 'all'
this.infoForm.fieldsJson = JSON.parse(this.billTmplInfo.fieldsJson)
this.tmplSelectList = this.infoForm.fieldsJson.map(i => i.id)
this.infoForm.fieldsTxt = this.getFieldsTxt()
// this.page.pageNum = this.billTmplInfo?.orderPage?.pageNum || 1
// this.page.pageSize = this.billTmplInfo?.orderPage?.pageSize || 10
......@@ -1339,19 +1347,12 @@ export default {
this.billComputePage()
},
accountValid() {
var flag = true
this.$refs.accountForm.validate(accountValid => {
if (!accountValid) {
flag = false
}
})
return flag
},
handleConfirm() {
// this.handleResetSearch()
// this.isFirst = true
// this.billComputePage()
const validFlag = this.billTypeStr == 'traffic' ? (this.$refs.dynamicReceiveAdd.validateForm() && this.$refs.dynamicAdd.validateForm()) : this.$refs.dynamicAdd.validateForm()
if (this.validateForm() && validFlag && this.accountValid()) {
if (this.validateForm() && validFlag) {
const dynamicForm = {
id: this.orderId,
updatedOrders: deepClone(this.tableModifyList),
......@@ -1359,7 +1360,7 @@ export default {
receivableAdjustments: this.$refs.dynamicReceiveAdd?.dynamicForm.tableData || [],
payableAdjustments: this.$refs.dynamicAdd?.dynamicForm.tableData || [],
sceneType: this.sceneType,
templateId: this.infoForm.templateId,
templateId: this.infoForm.templateId == 'all' ? '' : this.infoForm.templateId,
fieldsJson: this.infoForm.fieldsJson
}
// console.log(dynamicForm, 'dynamicForm')
......@@ -1406,10 +1407,10 @@ export default {
if (editList.includes(k.fieldCode)) {
if (this.editObj.select.attrList.includes(k.fieldCode)) {
k.editType = 'select'
k.width = '120px'
k.width = '150px'
k.editObj = {
...this.editObj.select.defaultConf[k.fieldCode],
width: '110px'
width: '140px'
}
}
if (this.editObj.input.attrList.includes(k.fieldCode)) {
......@@ -1451,16 +1452,30 @@ export default {
k.txtType = 'selectInput'
k.txtObj = {
selectField: k.fieldCode.split(',')[0],
inputField: k.fieldCode.split(',')[1],
inputField: k.fieldCode.split(',')[1]
}
}
}
})
this.tableHeader.push({
moduleName: item,
items: list
})
if (item == '商品信息') {
this.tableHeader.push({
moduleName: item,
items: [list[0]]
})
this.tableHeader.push({
moduleName: item,
items: [list[1]]
})
this.tableHeader.push({
moduleName: item,
items: list.slice(2)
})
} else {
this.tableHeader.push({
moduleName: item,
items: list
})
}
})
console.log(this.tableHeader, 'v---')
this.dealTableData(this.tableHeader)
......@@ -1549,12 +1564,12 @@ export default {
* */
if (this.billTypeStr == 'service') {
if (value.ORDER.sourceType == 1) {
if (['SUB_ORDERsecondPartnerFee'].includes(source + fieldConfig.fieldCode)) {
if (['SUB_ORDERsecondPartnerFee', 'ORDERpayType'].includes(source + fieldConfig.fieldCode)) {
isDisable = true
}
}
if (value.ORDER.sourceType != 1) {
if (['SUB_ORDERpartnerFeeCalculateType,partnerFeeCalculateValue', 'SUB_ORDERpartnerFeeCalculateCoefficient'].includes(source + fieldConfig.fieldCode)) {
if (['SUB_ORDERpartnerFeeCalculateType,partnerFeeCalculateValue', 'SUB_ORDERpartnerFeeCalculateCoefficient', 'ORDERpayType'].includes(source + fieldConfig.fieldCode)) {
isDisable = true
}
}
......@@ -1642,6 +1657,9 @@ export default {
row.ORDER.payVoucherList.forEach(item => {
this.imgList.push(item.payVoucher)
})
if (!this.imgList.length) {
return true
}
this.imgVisible = !this.imgVisible
},
handlePreviewClose() {
......@@ -1818,9 +1836,11 @@ export default {
}
}
.privacyDrawer {
box-sizing: border-box;
padding: 20px;
overflow: scroll;
height: calc(100% - 120px);
height: auto;
max-height: calc(100vh - 148px);
}
.flex {
display: flex;
......@@ -1925,11 +1945,11 @@ export default {
display: inline-block; /* 或者 inline */
}
.tb-cell {
padding: 6px;
padding: 0px 6px;
text-align: center;
}
::v-deep .el-table .cell {
padding: 6px !important;
padding: 0px 6px !important;
text-align: center;
}
::v-deep .el-table__footer-wrapper tbody td {
......@@ -1982,6 +2002,7 @@ export default {
align-items: center;
// text-align: right;
padding: 0 30px;
background: #ffffff;
.btn-box {
background: #ffffff;
width: 200px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!