chenrui 3 mēneši atpakaļ
vecāks
revīzija
2b62e66f01

+ 12 - 0
src/api/dealerAccount.js

@@ -80,3 +80,15 @@ export const dealerAccountExport = (params) => {
     }
   })
 }
+
+// 经销商账户  统计
+export const queryDealerAccount = (params) => {
+  return axios({
+    url: '/dealerAccount/queryDealerAccount',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('保存')
+    }
+  })
+}

+ 1 - 1
src/config/dealerManagement.js

@@ -131,7 +131,7 @@ export default {
           }
         },
         {
-          path: 'detail/:sn/:name/:num',
+          path: 'detail/:sn/:aSn',
           name: 'dealerAccountDetail',
           component: () => import(/* webpackChunkName: "dealerManagement" */ '@/views/dealerManagement/dealerAccount/detail.vue'),
           meta: {

+ 11 - 3
src/views/dealerManagement/dealerAccount/checkAccountModal.vue

@@ -19,7 +19,7 @@
           :wrapper-col="formItemLayout.wrapperCol"
         >
           <a-form-model-item label="客户名称">
-            {{ $route.params.name }}
+            {{ dealerName||'--' }}
           </a-form-model-item>
           <a-form-model-item label="调账金额" prop="changeAmount">
             <a-input-number
@@ -34,12 +34,12 @@
           <a-row :gutter="16">
             <a-col :span="10">
               <a-form-model-item label="调账前" :label-col="{span:10}" :wrapper-col="{ span: 10}">
-                {{ ($route.params.num||$route.params.num==0) ?toThousands($route.params.num):'--' }}
+                {{ (dealerNum||dealerNum==0) ?toThousands(dealerNum):'--' }}
               </a-form-model-item>
             </a-col>
             <a-col :span="12">
               <a-form-model-item label="调账后" :label-col="{span:10}" :wrapper-col="{ span: 10}">
-                {{ ($route.params.num||$route.params.num==0) ?(form.changeAmount||form.changeAmount==0) ?toThousands($route.params.num*1+form.changeAmount*1):'--' :'--' }}
+                {{ (dealerNum||dealerNum==0) ?(form.changeAmount||form.changeAmount==0) ?toThousands(dealerNum*1+form.changeAmount*1):'--' :'--' }}
               </a-form-model-item>
             </a-col>
           </a-row>
@@ -78,6 +78,14 @@ export default {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
+    },
+    dealerName: {
+      type: String,
+      default: ''
+    },
+    dealerNum: {
+      type: [String, Number],
+      default: ''
     }
   },
   data () {

+ 24 - 7
src/views/dealerManagement/dealerAccount/detail.vue

@@ -6,7 +6,8 @@
           <!-- 自定义的二级文字标题 -->
           <template slot="subTitle">
             <a id="dealerAccountDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-            <span class="subTitle-word text-overflow" style="margin:0 15px;">轮胎补贴金额({{ $route.params.name }}):<span style="vertical-align: middle;">¥</span><span style="font-size:20px;vertical-align: text-bottom;">{{ toThousands($route.params.num) }}</span></span>
+            <span v-if="totalData" class="subTitle-word text-overflow" style="margin:0 15px;vertical-align: middle;"><span>轮胎补贴金额({{ totalData.dealerEntity?totalData.dealerEntity.dealerName?totalData.dealerEntity.dealerName:'--':'--' }}):¥</span><span style="font-size:20px;" >{{ (totalData.subsidyTire||totalData.subsidyTire==0)?toThousands(totalData.subsidyTire):'--' }}</span></span>
+            <span v-else>--</span>
             <a-button
               type="danger"
               v-if="$hasPermissions('B_checkAccount')"
@@ -92,7 +93,14 @@
       </a-card>
     </a-spin>
     <!-- 调账 -->
-    <check-account-modal v-drag ref="checkAccountModal" :openModal="openCheckAccountModal" @ok="$refs.table.refresh(true)" @close="openCheckAccountModal = false" />
+    <check-account-modal
+      v-drag
+      ref="checkAccountModal"
+      :dealerName="totalData&&totalData.dealerEntity&&totalData.dealerEntity.dealerName?totalData.dealerEntity.dealerName:''"
+      :dealerNum="totalData&&totalData.subsidyTire?totalData.subsidyTire:''"
+      :openModal="openCheckAccountModal"
+      @ok="$refs.table.refresh(true)"
+      @close="openCheckAccountModal = false" />
     <!-- 调账记录 -->
     <check-record-modal v-drag :openModal="openCheckRecordModal" @ok="$refs.table.refresh(true)" @close="openCheckRecordModal = false" />
   </div>
@@ -107,7 +115,7 @@ import checkAccountModal from './checkAccountModal.vue'
 import checkRecordModal from './checkRecordModal.vue'
 import { hdExportExcel } from '@/libs/exportExcel'
 // 接口
-import { dealerAccountFlowList, dealerAccountFlowExport } from '@/api/dealerAccount'
+import { dealerAccountFlowList, dealerAccountFlowExport, queryDealerAccount } from '@/api/dealerAccount'
 export default {
   name: 'DealerAccountDetail',
   mixins: [commonMixin],
@@ -137,12 +145,14 @@ export default {
         { title: '金额(¥)', dataIndex: 'flowAmount', width: '16%', align: 'center', customRender: text => { return (text || text == 0) ? _this.toThousands(text) : '--' } },
         { title: '备注', dataIndex: 'remark', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ],
+      totalData: null,
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         this.queryParam.dealerSn = this.$route.params.sn
+        const params = Object.assign(parameter, this.queryParam)
         // 获取列表数据  有分页
-        return dealerAccountFlowList(Object.assign(parameter, this.queryParam)).then(res => {
+        return dealerAccountFlowList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -151,6 +161,7 @@ export default {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
             }
+            this.getCount()
           }
           this.disabled = false
           this.spinning = false
@@ -170,6 +181,15 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
+    getCount () {
+      queryDealerAccount({ accountSn: this.$route.params.aSn }).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
     // 重置
     resetSearchForm () {
       this.queryParam = {
@@ -218,18 +238,15 @@ export default {
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.pageInit()
-      this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
       this.pageInit()
-      this.resetSearchForm()
     }
     // 仅刷新列表,不重置页面
     if (this.$store.state.app.updateList) {
-      this.$refs.table.refresh()
       this.pageInit()
     }
   },

+ 1 - 1
src/views/dealerManagement/dealerAccount/list.vue

@@ -151,7 +151,7 @@ export default {
     },
     // 轮胎补贴金额  点击跳转详情页
     handleDetail (row) {
-      this.$router.push({ name: 'dealerAccountDetail', params: { sn: row.dealerSn, name: row.dealerEntity.dealerName, num: row.subsidyTire } })
+      this.$router.push({ name: 'dealerAccountDetail', params: { sn: row.dealerSn, aSn: row.accountSn } })
     },
     //  重置
     resetSearchForm () {

+ 3 - 3
src/views/reportData/tireSubsidyReport/incrementalSubsidyList.vue

@@ -83,11 +83,11 @@
           :pagination="{pageSizeOptions: ['20','50','100','200','500']}"
           :defaultLoadData="false"
           bordered>
-          <!-- 季度增量补贴 -->
+          <!-- 季度增量补贴金额 -->
           <template slot="subsidyAmount" slot-scope="text, record">
             <span v-if="record.subsidyAmount||record.subsidyAmount==0">
-              <span v-if="record.subsidyAmount>=0">{{ record.subsidyAmount }}</span>
-              <span style="color:#ED1C24;" v-else>{{ record.subsidyAmount }}</span>
+              <span v-if="record.subsidyAmount>=0">{{ toThousands(record.subsidyAmount) }}</span>
+              <span style="color:#ED1C24;" v-else>{{ toThousands(record.subsidyAmount) }}</span>
             </span>
             <span v-else>--</span>
           </template>

+ 5 - 5
src/views/reportData/tireSubsidyReport/incrementalSubsidyYearList.vue

@@ -93,19 +93,19 @@
           :pagination="{pageSizeOptions: ['20','50','100','200','500']}"
           :defaultLoadData="false"
           bordered>
-          <!-- 季度增量补贴 -->
+          <!-- 季度增量补贴金额 -->
           <template slot="subsidyAmount" slot-scope="text, record">
             <span v-if="record.subsidyAmount||record.subsidyAmount==0">
-              <span v-if="record.subsidyAmount>=0">{{ record.subsidyAmount }}</span>
-              <span style="color:#ED1C24;" v-else>{{ record.subsidyAmount }}</span>
+              <span v-if="record.subsidyAmount>=0">{{ toThousands(record.subsidyAmount) }}</span>
+              <span style="color:#ED1C24;" v-else>{{ toThousands(record.subsidyAmount) }}</span>
             </span>
             <span v-else>--</span>
           </template>
           <!-- 剩余增量补贴金额 -->
           <template slot="settleAmountWait" slot-scope="text, record">
             <span v-if="record.settleAmountWait||record.settleAmountWait==0">
-              <span style="color:#ED1C24;" v-if="record.subsidyAmount>0">{{ record.subsidyAmount }}</span>
-              <span v-else>{{ record.subsidyAmount }}</span>
+              <span style="color:#ED1C24;" v-if="record.settleAmountWait>0">{{ toThousands(record.settleAmountWait) }}</span>
+              <span v-else>{{ toThousands(record.settleAmountWait) }}</span>
             </span>
             <span v-else>--</span>
           </template>