lilei hace 11 horas
padre
commit
198e95feda

+ 19 - 11
src/views/financialManagement/accountStatement/confrontModal.vue

@@ -169,6 +169,10 @@ export default {
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
         params.verifyAccountBillSn = this.verifyAccountBillSn
+        const beginFlag = (!!params.beginDate && !!params.endDate)
+        const a = !params.bizNo && !params.changeType && !params.bizType
+        const b = !params.beginDate && !params.endDate
+        params.beginFlag = beginFlag && a || a && b ? 1 : 0
         return verifyAcountBillDetailQueryList(params).then(res => {
           let data
           if (res.status == 200) {
@@ -177,18 +181,22 @@ export default {
             let prevTotalAmount = 0
             for (var i = 0; i < data.length; i++) {
               data[i].no = no + i + 1
-              const dates = data[i].bizDate.split('-')
-              data[i].year = dates[0]
-              data[i].month = dates[1]
-              data[i].day = dates[2].split(' ')[0]
-              // 正为借方, 负数为贷方
-              if (data[i].bizAmount > 0) {
-                data[i].debitAmount = Number(data[i].bizAmount).toFixed(2)
-              } else {
-                data[i].creditorAmount = Number(data[i].bizAmount * -1).toFixed(2)
+              if (data[i].bizDate) {
+                const dates = data[i].bizDate.split('-')
+                data[i].year = dates[0]
+                data[i].month = dates[1]
+                data[i].day = dates[2].split(' ')[0]
+              }
+              if (params.beginFlag == 0) {
+                // 正为借方, 负数为贷方
+                if (data[i].bizAmount > 0) {
+                  data[i].debitAmount = Number(data[i].bizAmount).toFixed(2)
+                } else {
+                  data[i].creditorAmount = Number(data[i].bizAmount * -1).toFixed(2)
+                }
+                data[i].totalAmount = Number(Number(prevTotalAmount || 0) + Number(data[i].debitAmount || 0) - Number(data[i].creditorAmount || 0)).toFixed(2)
+                prevTotalAmount = data[i].totalAmount
               }
-              data[i].totalAmount = Number(Number(prevTotalAmount || 0) + Number(data[i].debitAmount || 0) - Number(data[i].creditorAmount || 0)).toFixed(2)
-              prevTotalAmount = data[i].totalAmount
             }
             this.total = data.length || 0 + 1
             this.disabled = false

+ 11 - 8
src/views/financialManagement/accountStatementBill/list.vue

@@ -172,6 +172,9 @@ export default {
         this.disabled = true
         this.spinning = true
         const params = this.queryParam
+        parameter.sortOrder = parameter.sortOrder == 'ascend' ? 'asc' : parameter.sortOrder == 'descend' ? 'desc' : ''
+        const fileds = { 'totalBalance': 'total_balance', 'confirmBalance': 'confirm_balance', 'waitConfirmBalance': 'wait_confirm_balance', 'newBizBalance': 'new_biz_balance' }
+        parameter.sortField = fileds[parameter.sortField]
         const params1 = {
           dealer: {
             nameLike: params.nameLike,
@@ -211,20 +214,20 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '财务编码', dataIndex: 'dealer.kdMidCustomerFnumber', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '经销商名称', dataIndex: 'dealer.dealerName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '商户别名', dataIndex: 'dealer.dealerAlias', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '总余额', scopedSlots: { customRender: 'totalBalance' }, width: '6%', align: 'center' },
-        { title: '已对单余额', scopedSlots: { customRender: 'confirmBalance' }, dataIndex: 'confirmBalance', width: '6%', align: 'center' },
-        { title: '待对单余额', scopedSlots: { customRender: 'waitConfirmBalance' }, dataIndex: 'waitConfirmBalance', width: '6%', align: 'center' },
-        { title: '待选余额', scopedSlots: { customRender: 'newBizBalance' }, dataIndex: 'newBizBalance', width: '6%', align: 'center' },
+        { title: '经销商名称', dataIndex: 'dealer.dealerName', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户别名', dataIndex: 'dealer.dealerAlias', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '总余额', scopedSlots: { customRender: 'totalBalance' }, dataIndex: 'totalBalance', width: '6%', align: 'center', sorter: true },
+        { title: '已对单余额', scopedSlots: { customRender: 'confirmBalance' }, dataIndex: 'confirmBalance', width: '7%', align: 'center', sorter: true },
+        { title: '待对单余额', scopedSlots: { customRender: 'waitConfirmBalance' }, dataIndex: 'waitConfirmBalance', width: '7%', align: 'center', sorter: true },
+        { title: '待选余额', scopedSlots: { customRender: 'newBizBalance' }, dataIndex: 'newBizBalance', width: '6%', align: 'center', sorter: true },
         { title: '待选单数', dataIndex: 'newBizCount', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '最新业务月份', dataIndex: 'lastBizDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '最新业务月份', dataIndex: 'lastBizDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客服', dataIndex: 'kfName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '区域', dataIndex: 'dealer.subareaArea.subareaName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '分区', dataIndex: 'dealer.subareaArea.subareaAreaName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '省份', dataIndex: 'dealer.provinceName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '商户级别', dataIndex: 'dealer.dealerLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户类型', scopedSlots: { customRender: 'dealerType' }, width: '15%', align: 'center' },
+        { title: '商户类型', scopedSlots: { customRender: 'dealerType' }, width: '14%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       return arr