Browse Source

业务员账户新增详情跳转功能

qymljy 1 year ago
parent
commit
70c416107e

+ 12 - 2
src/SDrpManagement/salerAccount/index.vue

@@ -41,7 +41,7 @@
         </div>
       </template>
       <template v-slot:tbOpreation="scope">
-        <detail :hrid="scope.data.data.hrid"></detail>
+        <el-button size="small" type="text" @click="goDetail(scope.data.data)">明 细</el-button>
       </template>
     </basicLayout>
   </div>
@@ -58,7 +58,8 @@ export default {
       status:'',
       tablecols:[],
       param:{},
-      checked:'1'
+      checked:'1',
+      goID:''
     }
   },
   methods:{
@@ -67,6 +68,15 @@ export default {
       this.$refs.basicLayout.param.content.where.issaler = this.checked
       this.param = this.$refs.basicLayout.param
       this.$refs.basicLayout.listData()
+    },
+    goDetail(row){
+      this.$store.dispatch('changeDetailDrawer',true)
+      this.$router.push({
+        path:'/salerAccountDetail',
+        query:{
+          id:row.hrid,
+        }
+      })
     }
   },
   mounted() {

+ 53 - 2
src/SDrpManagement/salerAccount/modules/detail.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-button size="small" type="text" @click="onShow(dialogFormVisible = true)">明 细</el-button>
+<!--    <el-button size="small" type="text" @click="onShow(dialogFormVisible = true)">明 细</el-button>-->
     <el-drawer
         title="账户流水明细"
         :visible.sync="dialogFormVisible"
@@ -46,10 +46,16 @@
             <div v-if="scope.column.columnname === 'type'">
               {{scope.column.data[[scope.column.columnname]] == '1' ? '收入':'支出'}}
             </div>
+            <div v-else-if="scope.column.columnname === 'amount'">
+              {{tool.formatAmount(scope.column.data[[scope.column.columnname]],2)}}
+            </div>
             <div v-else>
               {{scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation'?scope.column.data[[scope.column.columnname]]:'--'}}
             </div>
           </template>
+          <template v-slot:opreation="scope">
+            <el-button type="text" size="mini" @click="detailGo(scope.data)">详情</el-button>
+          </template>
         </tableNewLayout>
 <!--        <div  class="container normal-panel" style="text-align:right">
           <el-pagination
@@ -102,10 +108,11 @@ export default {
   },
   methods:{
     onShow(){
+      /*this.$emit('detailId',this.hrid)*/
       this.listData()
     },
     async listData(){
-      this.param.content.hrid = this.hrid
+      this.param.content.hrid = this.$route.query.id
       const res = await this.$api.requested(this.param)
       this.list = res.data.rows
       /*this.total = res.total
@@ -123,6 +130,8 @@ export default {
       this.listData()
     },
     onClose(){
+      this.$store.dispatch('changeDetailDrawer',false)
+      this.dialogFormVisible = false
       this.param.content.where = {
         "condition": "",
         "begdate": "",
@@ -140,6 +149,48 @@ export default {
       this.param.content.pageNumber = val
       this.listData()
     },
+    detailGo(row){
+      console.log(row)
+      if (row.type === '1'){
+        let route = this.$route
+        if (route.path !== '/salerIncomeDetail') {
+          this.oldRoute = {path:route.path,query:route.query}
+          this.$store.dispatch('setHistoryRouter',this.oldRoute)
+        }
+        this.$store.dispatch('changeDetailDrawer',true)
+        this.$router.push({
+          path:'/salerIncomeDetail',
+          query:{
+            id:row.sa_hrcashbillid,
+            rowindex:row.rowindex
+          }
+        })
+      }else {
+        let route = this.$route
+        if (route.path !== '/salerExpenditureDetail') {
+          this.oldRoute = {path:route.path,query:route.query}
+          this.$store.dispatch('setHistoryRouter',this.oldRoute)
+        }
+        this.$store.dispatch('changeDetailDrawer',true)
+        this.$router.push({
+          path:'/salerExpenditureDetail',
+          query:{
+            id:row.sa_hrcashbillid,
+            rowindex:row.rowindex
+          }
+        })
+      }
+    },
+    async drawerGo(id){
+      this.dialogFormVisible = true
+      this.param.content.hrid = id
+      const res = await this.$api.requested(this.param)
+      this.list = res.data.rows
+    }
+  },
+  mounted() {
+    this.dialogFormVisible = true
+    this.listData()
   },
   created() {
     this.tablecols = this.tool.tabelCol(this.$route.name).accountDetailTable.tablecols

+ 5 - 1
src/components/normal-basic-layout/drawerDetail/drawer.vue

@@ -55,7 +55,11 @@ export default {
           }
 
         }else {
-          if (this.historyRouter.path === '/message' || this.historyRouter.path === '/salesData' || this.historyRouter.path === '/task'){
+          if (this.historyRouter.path === '/message' || this.historyRouter.path === '/salesData' || this.historyRouter.path === '/task' ){
+            this.$store.dispatch('changeDetailDrawer',false)
+            this.$router.replace(this.historyRouter)
+            this.$store.dispatch('setHistoryRouter',null)
+          }else if(this.historyRouter.path === '/salerAccount'){
             this.$store.dispatch('changeDetailDrawer',false)
             this.$router.replace(this.historyRouter)
             this.$store.dispatch('setHistoryRouter',null)

+ 12 - 0
src/router/SDrpManagement.js

@@ -340,6 +340,18 @@ const SDrpManagement = [
       keeproute: true,
     },
     component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/salerAccount/index'),
+    children: [
+      {
+        path: '/salerAccountDetail',
+        name:'salerAccount',
+        meta: {
+          title: '业务员账户明细',
+          ast_nav: true,
+          keeproute: true,
+        },
+        component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/salerAccount/modules/detail')
+      },
+    ]
   },
   {
     path: '/salerIncome',